taro-f2 icon indicating copy to clipboard operation
taro-f2 copied to clipboard

提示 Taro is not defined

Open Yana5417 opened this issue 5 years ago • 4 comments

按照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>

请问是什么原因?怎么解决呢?

Yana5417 avatar Dec 17 '19 08:12 Yana5417

按照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可以处理一下吗?

Yana5417 avatar Dec 17 '19 13:12 Yana5417

+1 image

giantss avatar Jan 06 '20 11:01 giantss

/node_modules/taro-f2/dist/h5/index.js 加一行 import Taro from '@tarojs/taro' 导入 Taro 可以暂时解决这个问题 @Yana5417

giantss avatar Jan 06 '20 12:01 giantss

这个问题能处理下吗 @xioxin

zhangjie1314 avatar Jun 18 '20 08:06 zhangjie1314