ThirdParty/zip.js在vue+cesium报错解决
error in ./node_modules/cesium/Source/ThirdParty/zip.jsModule parse failed: Unexpected token (6357:57)You may need an appropriate loader to handle this file type.||function getWorker(options = {}) {|r
error in ./node_modules/cesium/Source/ThirdParty/zip.js
Module parse failed: Unexpected token (6357:57)
You may need an appropriate loader to handle this file type.
|
| function getWorker(options = {}) {
| return new Worker(new URL(workerData.scripts[0], import.meta.url), options);
| }
|
第一步:
npm install @open-wc/webpack-import-meta-loader --save-dev
yarn add @open-wc/webpack-import-meta-loader --dev
第二步:
然后在vue.config.js中添加(在plugins[…]后面)
module: {
rules: [
{
test: /\.js$/,
use: {
loader: '@open-wc/webpack-import-meta-loader',
},
},
]}
第三步:
编译报错继续解决
错误:
error in (webpack)/hot/dev-server.js
Module build failed: TypeError: Cannot read property 'length' of undefined
at Object.module.exports (F:\demo\cesiumtest-master\node_modules\@open-wc\webpack-import-meta-loader\webpack-import-meta-loader.js:20:63)
解决方法:
注释掉下载包中的代码如图红框处:
问题解决:
这样很棒!
如果对您有帮忙,非常感谢您支持一下创造者的付出!
感谢支持技术分享,请扫码点赞支持:
技术合作交流qq:2401315930
更多推荐
所有评论(0)