taro-f2
taro-f2 copied to clipboard
提示 Taro is not defined
按照README.md中提供的方法,写了一个范例。
npm run dev:h5的时候提示 Compiled successfully!
,
但是控制台打印结果报错:**Taro is not defined**
。
具体报错信息如下:
ReferenceError: Taro is not defined at eval (index.js?bd59:4) at Module../node_modules/taro-f2/dist/h5/index.js (vendors~index_index.js:151) at __webpack_require__ (app.js:767) at fn (app.js:130) at eval (index.js:6) at Module../.temp/pages/index/index.js (index_index.js:11) at __webpack_require__ (app.js:767) at fn (app.js:130) at <anonymous>
请问是什么原因?怎么解决呢?
按照README.md中提供的方法,写了一个范例。 npm run dev:h5的时候提示
Compiled successfully!
, 但是控制台打印结果报错:**Taro is not defined**
。 具体报错信息如下:
ReferenceError: Taro is not defined at eval (index.js?bd59:4) at Module../node_modules/taro-f2/dist/h5/index.js (vendors~index_index.js:151) at __webpack_require__ (app.js:767) at fn (app.js:130) at eval (index.js:6) at Module../.temp/pages/index/index.js (index_index.js:11) at __webpack_require__ (app.js:767) at fn (app.js:130) at <anonymous>
请问是什么原因?怎么解决呢?
我这边检查到是taro-f2这个node包里面,dist/h5/index.js中没有引入Taro,请问这个Bug可以处理一下吗?
+1
/node_modules/taro-f2/dist/h5/index.js
加一行 import Taro from '@tarojs/taro'
导入 Taro
可以暂时解决这个问题 @Yana5417
这个问题能处理下吗 @xioxin