引入runtime.js识别不到

发布于 6 年前作者 fangzheng2485 次浏览最后编辑 6 年前来自 ask

我再fb的官网下载了runtime包

https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime

然后在js脚本文件中

使用:

const regeneratorRuntime = require(‘…/…/regenerator-runtime/runtime.js’)

勾选了ES6转ES5的选项

目录结构如图

我再relationResult下的页面 倒入runtime包,时 报错如下:

 sdk uncaught third Error 

 module “regenerator-runtime/runtime.js” is not defined 

 Error: module “regenerator-runtime/runtime.js” is not defined

2 回复
zding
zding1 楼6 年前

文件名:regenerator

引入路径:…/regenerator-runtime

taozhou
taozhou2 楼5 年前

路径没写对 , const regeneratorRuntime = require(‘…/…/regenerator/runtime.js’)