Closed steenburgh closed 2 years ago
@bigopon, can you check the changes on aurelia-testing? Might need to update our skeleton.
@steenburgh can you help paste the output of the following;
npm ls aurelia-templating aurelia-testing aurelia-framework
> npm ls aurelia-templating aurelia-testing aurelia-framework
aurelia-cli-test@0.1.0 C:\SourceCode\aurelia-cli-test
+-- aurelia-animator-css@1.0.4
| `-- aurelia-templating@1.11.1
+-- aurelia-bootstrapper@2.4.0
| +-- aurelia-framework@1.4.1
| | `-- aurelia-templating@1.11.1 deduped
| +-- aurelia-templating-binding@1.6.0
| | `-- aurelia-templating@1.11.1 deduped
| +-- aurelia-templating-resources@1.14.3
| | `-- aurelia-templating@1.11.1 deduped
| +-- aurelia-templating-router@1.5.0
| | `-- aurelia-templating@1.11.1 deduped
| `-- aurelia-templating@1.11.1 deduped
+-- aurelia-testing@1.1.0
| +-- aurelia-framework@1.4.1 deduped
| `-- aurelia-templating@1.11.1 deduped
`-- aurelia-webpack-plugin@5.0.4
`-- aurelia-loader-webpack@2.2.4
`-- aurelia-hot-module-reload@0.3.0
`-- aurelia-templating@1.11.1 deduped
Version 1.1.0, which was published last Friday (May 6, 2022) does not include either of these files in its build output. Perhaps this was an unintentional breaking change(?). If so, I can open a bug report in aurelia/testing
This is how our latest code looks like for the testing module https://github.com/aurelia/testing/blob/master/dist/native-modules/aurelia-testing.js
Basically the change was from:
export function configure(config) {
config.globalResources(['./compile-spy', './view-spy']);
}
to
import { CompileSpy } from './compile-spy'
import { ViewSpy } from './view-spy'
export function configure(config) {
config.globalResources([CompileSpy, ViewSpy]);
}
So there shouldn't be any issue like mentioned above. Any chance the app was created with aurelia-testing@1.0.0
and built (resulted in a webpack cache), then updated to aurelia-testing@1.1.0
and thus resulted in a build-from-cache error? Can you clean all node_modules & package lock and try again?
I'm generating a brand new app with aurelia-cli, so there definitely wasn't any existing node_modules/package-lock in the directory before I ran aurelia-cli
.
In our webpack config, there's these lines:
new ModuleDependenciesPlugin({
'aurelia-testing': ['./compile-spy', './view-spy']
}),
Removing them should fix the issue. I didn't realize we had those, probably will also need to update our skeleton.
Is there any concern that existing apps using projects generated by the aurelia-cli that will be broken, since they both contain this line, and depend on the latest minor version of aurelia-testing, so they'll automatically receive v1.1.0 on their next build? This is what happened to my project, which is why I started trying to find the root cause.
Sorry for the breakage, I've just only realized this now.
I think there' two choices:
I'm quite tempted to go with (1)
, though (2)
is a much more peaceful approach.
@steenburgh I've just re-read the PR description, it appeared I missed all the information you've analysed. Thanks for the details.
The patch is merged. Pls close this issue after verify. Thx!
I've published a blog here to address the issue https://aurelia.io/blog/2022/5/10/aurelia-updates-for-may-2022/
I'm submitting a bug report
Please tell us about your environment
Operating System: Windows 10
Node Version: 16.14.2
NPM Version: 8.5.0
Browser: N/A
Language: TypeScript 4.6.4
Loader/bundler: Webpack
Current behavior
au new
in an empty folder. SelectDefault TypeScript App
orDefault ESNext App
. I suspect this also is also reproducible with any custom config one might setup that uses Webpacknpm start
Webpack begins to load up and exits with the following errors:
Webpack should run successfully, and begin hosting the new app
Workaround
This problem is caused by the latest version of the
aurelia-testing
module, v1.1.0. I can resolve this by manually installing the previous version,1.0.0
More details
It looks like the
ModuleDependenciesPlugin
is attempting to importcompile-spy
andview-spy
as a dependency of theaurelia-testing
library here: https://github.com/aurelia/v1/blob/master/webpack/webpack.config.js#L309-L311Version 1.0.0 of the
aurelia-testing
module includesview-spy.js
andcompile-spy.js
, which are what I assume theModuleDependenciesPlugin
is looking for.Version 1.1.0, which was published last Friday (May 6, 2022) does not include either of these files in its build output. Perhaps this was an unintentional breaking change(?). If so, I can open a bug report in aurelia/testing
Full Error Log