尝试进行模板初始化时出现此错误。 潜在的未处理拒绝[6] TypeError:加载错误" js / bundle"在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js 评估文件时出错:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js 无法阅读属性' createElement'未定义的 在我(文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:1:17836) 在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:2:2295 在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:2:2989 at t(文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:1:3612) 在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:1:3617 在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:3:24280 在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:1:3260 在文件:/Users/MyUser/Documents/CentricSites/BigCommerce/Capacity/assets/js/bundle.js:1:3343 at Object.exports.runInThisContext(vm.js:54:17) 在doEval(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:2400:10) at __eval(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:2317:7) 在Loader.exec [as __exec](/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:339:5) 在Loader.loader.instantiate(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:802:14) 在Loader.loader.instantiate(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:1135:30) 在Loader.loader.instantiate(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:1234:30) 在Loader.loader.instantiate(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:1534:30) 在Loader.loader.instantiate(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs/dist/system.src.js:1842:32) 在Loader.loader.instantiate(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/systemjs-builder/compilers/amd.js:354:36) at /usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:1545:33 at tryCatchReject(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:1183:30) at runContinuation1(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:1142:4) 在Fulfilled.when(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:930:4) 在Pending.run(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:821:13) 在Scheduler._drain(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:97:19) 在Scheduler.drain(/usr/local/lib/node_modules/@bigcommerce/stencil-cli/node_modules/es6-module-loader/dist/es6-module-loader.src.js:62:9) at nextTickCallbackWith0Args(node.js:452:9) at process._tickCallback(node.js:381:13)
我甚至不确定我在寻找什么。
答案 0 :(得分:0)
我一直遇到同样的问题。最终为我工作的是下载主题的新zip文件,运行npm install
,jspm install
,然后在运行stencil init
之前删除assets / js / bundle.js文件。
答案 1 :(得分:0)
取出node_modules和jspm包,然后按正确的顺序(从根目录)重新安装它们rm -rf node_modules/ && rm -rf assets/jspm_packages/ && npm install && jspm install
运行stencil init
并使用您的信息完成向导...您仍会收到错误(第3步将解决此问题)
现在删除bundle.js然后再次模板初始化rm assets/js/bundle.js && stencil init
完成模板初始化后,您不应该看到任何错误。像往常一样 - stencil start
&见http://localhost:3000/
上的前端