我在尝试构建我的 bundle 时遇到以下错误,您知道我遇到它的任何原因吗?
node_modules/setimmediate/setimmediate.js
中的某种功能
function installNextTickImplementation() {
registerImmediate = function(handle) {
process.nextTick(function () { runIfPresent(handle); });
};
}
被webpack取代
function installNextTickImplementation() {
registerImmediate = function(handle) {
{"env": {}}.nextTick(function () { runIfPresent(handle); });
};
}
导致
setImmediate.js:80 Uncaught SyntaxError: Unexpected token ':'
at Object../node_modules/setimmediate/setImmediate.js (main.js:989)
at __webpack_require__ (main.js:790)
at fn (main.js:101)
at Object.eval (main.js?5118:54)
at eval (main.js?5118:63)
at Object../node_modules/timers-browserify/main.js (main.js:1012)
at __webpack_require__ (main.js:790)
at fn (main.js:101)
at eval (vue.esm.js?a026:11993)
at Module../node_modules/vue/dist/vue.esm.js (main.js:1024)
当我执行以下操作时会发生 import Vue from 'vue'
最佳答案
更新时出现问题https://github.com/mrsteele/dotenv-webpack v1.7.0 到 v3.0.0
关于Vue.js + Webpack 我得到 setImmediate.js :80 Uncaught SyntaxError: Unexpected token ':' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64232479/