{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/cli/issues/852","repository_url":"https://api.github.com/repos/aurelia/cli","labels_url":"https://api.github.com/repos/aurelia/cli/issues/852/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/cli/issues/852/comments","events_url":"https://api.github.com/repos/aurelia/cli/issues/852/events","html_url":"https://github.com/aurelia/cli/issues/852","id":307393910,"number":852,"title":"Compilation fails with Webpack 4.2.0 when using `au run` through the CLI.","user":{"login":"weegeekps","id":284269,"avatar_url":"https://avatars1.githubusercontent.com/u/284269?v=4","gravatar_id":"","url":"https://api.github.com/users/weegeekps","html_url":"https://github.com/weegeekps","followers_url":"https://api.github.com/users/weegeekps/followers","following_url":"https://api.github.com/users/weegeekps/following{/other_user}","gists_url":"https://api.github.com/users/weegeekps/gists{/gist_id}","starred_url":"https://api.github.com/users/weegeekps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weegeekps/subscriptions","organizations_url":"https://api.github.com/users/weegeekps/orgs","repos_url":"https://api.github.com/users/weegeekps/repos","events_url":"https://api.github.com/users/weegeekps/events{/privacy}","received_events_url":"https://api.github.com/users/weegeekps/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-21T19:49:55Z","updated_at":"2018-03-21T20:37:54Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nBUGS: Please use this template.\r\n\r\nSUPPORT REQUESTS/QUESTIONS: If you have a support request or question please\r\nsubmit them to StackOverflow using the tags aurelia and aurelia-framework\r\nhttp://stackoverflow.com/questions/tagged/aurelia\r\nor the Aurelia Gitter https://gitter.im/aurelia/discuss\r\n\r\nBlue Spire offers paid support agreements. Further information regarding paid support\r\nmay be obtained by emailing support@bluespire.com\r\n\r\nFuture support requests submitted here will be closed.\r\n\r\nThe HTML comments below are for your reference, and are not displayed\r\nwhen your issue is submitted, feel free to leave them.\r\n\r\nChoose one of the two headings, delete the other.\r\n-->\r\n**I'm submitting a bug report**\r\n\r\n* **Library Version:**\r\n0.33.1\r\n\r\n\r\n**Please tell us about your environment:**\r\n* **Operating System:**\r\nOSX 10.13\r\n\r\n* **Node Version:**\r\n8.10.0\r\n<!--\r\nMinimum supported Node version is latest Node 4.x LTS\r\nrun `node -v`\r\n-->\r\n\r\n* **NPM Version:**\r\n5.6.0\r\n<!--\r\nMinimum supported NPM version is 3.x\r\nrun `npm -v`\r\n-->\r\n\r\n* **Browser:**\r\nall\r\n\r\n* **Language:**\r\nall\r\n\r\n* **Loader/bundler:**\r\nWebpack\r\n\r\n**Current behavior:**\r\nWhen running `au run` with Webpack 4.2.0 in a brand new project, an error occurs which prevents the application from compiling successfully:\r\n\r\n```\r\n✖ ｢wdm｣: ConcurrentCompilationError: You ran Webpack twice. Each instance only supports a single concurrent compilation at a time.\r\n    at Compiler.run (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:147:37)\r\n    at rebuild (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack-dev-middleware/lib/context.js:81:24)\r\n    at done (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack-dev-middleware/lib/context.js:59:7)\r\n    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/u0117404/Projects/test-webpack-broke/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:18:1)\r\n    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/u0117404/Projects/test-webpack-broke/node_modules/tapable/lib/Hook.js:35:21)\r\n    at emitRecords.err (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:199:22)\r\n    at Compiler.emitRecords (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:311:39)\r\n    at emitAssets.err (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:193:10)\r\n    at hooks.afterEmit.callAsync.err (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:297:14)\r\n    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/u0117404/Projects/test-webpack-broke/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:15:1)\r\n    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/u0117404/Projects/test-webpack-broke/node_modules/tapable/lib/Hook.js:35:21)\r\n    at asyncLib.forEach.err (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:294:27)\r\n    at done (/Users/u0117404/Projects/test-webpack-broke/node_modules/neo-async/async.js:2809:11)\r\n    at /Users/u0117404/Projects/test-webpack-broke/node_modules/neo-async/async.js:2760:7\r\n    at MemoryFileSystem.writeFile (/Users/u0117404/Projects/test-webpack-broke/node_modules/memory-fs/lib/MemoryFileSystem.js:328:9)\r\n    at writeOut (/Users/u0117404/Projects/test-webpack-broke/node_modules/webpack/lib/Compiler.js:280:29)\r\n```\r\n\r\nThis behavior does not occur if you run the project using `nps` or if you roll the Webpack version back to 4.1.1.\r\n\r\nThis appears to be somewhat related to this Pull Request in Webpack 8 days ago: https://github.com/webpack/webpack/pull/6691\r\n\r\nReproduction is fairly easy:\r\n\r\n1) Create a fresh project using `au new`.\r\n2) Install all dependencies using either `npm` or `yarn`. (I tested both.)\r\n3) Run `au run` and try to navigate to the page in any browser.\r\n\r\nThe error will occur.\r\n\r\n* **What is the expected behavior?**\r\n<!--\r\nIf the current behavior is a bug, please provide the steps to reproduce.\r\n-->\r\n\r\nWith a fresh CLI project we should see \"Hello world!\" when hitting the application for the first time.\r\n"},"comment":{"url":"https://api.github.com/repos/aurelia/cli/issues/comments/375087414","html_url":"https://github.com/aurelia/cli/issues/852#issuecomment-375087414","issue_url":"https://api.github.com/repos/aurelia/cli/issues/852","id":375087414,"user":{"login":"fkleuver","id":9655331,"avatar_url":"https://avatars1.githubusercontent.com/u/9655331?v=4","gravatar_id":"","url":"https://api.github.com/users/fkleuver","html_url":"https://github.com/fkleuver","followers_url":"https://api.github.com/users/fkleuver/followers","following_url":"https://api.github.com/users/fkleuver/following{/other_user}","gists_url":"https://api.github.com/users/fkleuver/gists{/gist_id}","starred_url":"https://api.github.com/users/fkleuver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkleuver/subscriptions","organizations_url":"https://api.github.com/users/fkleuver/orgs","repos_url":"https://api.github.com/users/fkleuver/repos","events_url":"https://api.github.com/users/fkleuver/events{/privacy}","received_events_url":"https://api.github.com/users/fkleuver/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T20:37:54Z","updated_at":"2018-03-21T20:37:54Z","author_association":"NONE","body":"It's a bit strange how this works, because all that the absence of `--watch` does is enable lazy mode for webpack-dev-server. I don't believe `--watch` actually affects whether files are watched or not. They are watched regardless. It only affects whether a recompile is triggered **directly after the change** or only after you **load/reload** the page.\r\n\r\nSo when in lazy mode (in other words, `run` without `--watch`), some process that is meant to invoke the compiler is probably already running but it doesn't invoke the compiler directly. The page load then calls the dev server which likely starts that same process. There is meant to be some logic in webpack to prevent two compilers from starting at the same time, and it seems that logic is broken in 4.2.0.\r\n\r\nI don't think there is a whole lot that can be done from `aurelia-cli` perspective apart from maybe excluding 4.2.0 in the dependency specification."}}
{"actor":{"display_login":"fkleuver"}}