我是Aurelia框架的新手,因此遵循创建项目https://aurelia.io/docs/tutorials/creating-a-contact-manager/#setting-up-your-machine的指南 我正在使用 au -v 的 0.33.1
但是,当我使用 au run 来运行应用程序时 当我尝试在浏览器中打开应用程序时出现错误消息,有人可以帮助我吗?
au run
Starting 'configureEnvironment'...
Finished 'configureEnvironment'
Starting 'runWebpack'...
(node:5780) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Project is running at http://localhost:8080
webpack output is served from /
Content not from webpack is served from F:\AureliaWorkspace\sampleApp\dist
404s will fallback to /index.html
Finished 'runWebpack'
Hash: 2a2f417dfbd63c84f978
Version: webpack 4.7.0
Time: 16633ms
Built at: 2018-05-05 20:24:50
Asset Size Chunks Chunk Names
app.2a2f417dfbd63c84f978.bundle.js 3 MiB app [emitted] [big] app
vendor.2a2f417dfbd63c84f978.bundle.js 489 KiB vendor [emitted] [big] vendor
index.html 589 bytes [emitted]
Entrypoint app [big] = app.2a2f417dfbd63c84f978.bundle.js
Entrypoint vendor [big] = vendor.2a2f417dfbd63c84f978.bundle.js
[./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js] 5.17 KiB {app} [built]
[./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js] 14.4 KiB {app} [built]
[./node_modules/aurelia-pal/dist/native-modules/aurelia-pal.js] 2.18 KiB {app} [built]
[./node_modules/aurelia-polyfills/dist/native-modules/aurelia-polyfills.js] 24.4 KiB {app} [built]
[./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js] 585 bytes {app} [built]
[./node_modules/aurelia-webpack-plugin/runtime/pal-loader-entry.js] 1.56 KiB {app} [built]
[./node_modules/bluebird/js/browser/bluebird.js] 175 KiB {vendor} {app} [built]
[./node_modules/bluebird/js/browser/bluebird.js-exposed] 65 bytes {vendor} {app} [built]
[./node_modules/process/browser.js] 5.29 KiB {vendor} {app} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {vendor} {app} [built]
[aurelia-framework] ./node_modules/aurelia-framework/dist/native-modules/aurelia-framework.js 14 KiB {app} [built]
[aurelia-pal-browser] ./node_modules/aurelia-pal-browser/dist/native-modules/aurelia-pal-browser.js 16.3 KiB {app} [built]
[main] ./src/main.js 5.16 KiB {app} [built]
[0] multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper 52 bytes {app} [built]
[1] multi bluebird 28 bytes {vendor} [built]
+ 262 hidden modules
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 1.36 MiB 0
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./index.ejs] 890 bytes {0} [built]
[./node_modules/lodash/lodash.js] 527 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
i 「wdm」: wait until bundle finished: /app.2a2f417dfbd63c84f978.bundle.js
i 「wdm」: wait until bundle finished: /vendor.2a2f417dfbd63c84f978.bundle.js
× 「wdm」: ConcurrentCompilationError: You ran Webpack twice. Each instance only supports a single concurrent compilation at a time.
at Compiler.run (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:151:37)
at rebuild (F:\AureliaWorkspace\sampleApp\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\context.js:81:24)
at done (F:\AureliaWorkspace\sampleApp\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware\lib\context.js:59:7)
at AsyncSeriesHook.eval [as callAsync] (eval at create (F:\AureliaWorkspace\sampleApp\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:18:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (F:\AureliaWorkspace\sampleApp\node_modules\tapable\lib\Hook.js:35:21)
at emitRecords.err (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:203:22)
at Compiler.emitRecords (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:315:39)
at emitAssets.err (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:197:10)
at hooks.afterEmit.callAsync.err (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:301:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (F:\AureliaWorkspace\sampleApp\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (F:\AureliaWorkspace\sampleApp\node_modules\tapable\lib\Hook.js:35:21)
at asyncLib.forEach.err (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:298:27)
at done (F:\AureliaWorkspace\sampleApp\node_modules\neo-async\async.js:2854:11)
at F:\AureliaWorkspace\sampleApp\node_modules\neo-async\async.js:2805:7
at MemoryFileSystem.writeFile (F:\AureliaWorkspace\sampleApp\node_modules\memory-fs\lib\MemoryFileSystem.js:328:9)
at writeOut (F:\AureliaWorkspace\sampleApp\node_modules\webpack\lib\Compiler.js:284:29)
答案 0 :(得分:1)
这是相关的错误:
ConcurrentCompilationError:你运行了两次Webpack。每个实例一次只支持一个并发编译。
你在这里没有做错任何事,这是由aurelia-cli和webpack的一些变化组合引起的回归。见github issue
简而言之,懒惰模式无法正常工作。解决方法是始终将--watch
标记与au run
一起使用。
au run --watch
应该有用。