Closed elitastic closed 2 years ago
I added a very simple test with filesystem cache enabled. Tests in pipeline are broken, is this caused by me?
"webpack" command seems to be missing in command line?
webpack --stats-error-details "--no-stats" 'webpack' is not recognized as an internal or external command,
npm install
npm WARN aurelia-webpack-plugin@5.0.3 requires a peer of webpack@>= 5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN aurelia-chart@0.3.4 requires a peer of chart.js@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN app-basic@ No description
npm WARN app-basic@ No repository field.
npm WARN app-basic@ No license field.
added 1 package from 4 contributors and audited 17 packages in 2.415s
71 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> app-basic@ build:ci D:\a\webpack-plugin\webpack-plugin\tests\app-basic
> npm run build -- --no-stats
> app-basic@ build D:\a\webpack-plugin\webpack-plugin\tests\app-basic
> webpack --stats-error-details "--no-stats"
'webpack' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app-basic@ build: `webpack --stats-error-details "--no-stats"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app-basic@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\npm\cache\_logs\2022-05-05T07_44_3[9](https://github.com/aurelia/webpack-plugin/runs/6302429069?check_suite_focus=true#step:5:9)_065Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app-basic@ build:ci: `npm run build -- --no-stats`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app-basic@ build:ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\npm\cache\_logs\2022-05-05T07_44_39_[10](https://github.com/aurelia/webpack-plugin/runs/6302429069?check_suite_focus=true#step:5:10)1Z-debug.log
Error: Process completed with exit code 1.
There's a bug when working with view-model.bind. In the below pasted scenario, "my-component" cannot be found when building from cache:
Uncaught (in promise) Error: Unable to find module with ID: 274.html
at WebpackLoader.<anonymous> (aurelia-loader-webpack.js:221:1)
at step (aurelia-loader-webpack.js:68:1)
at Object.next (aurelia-loader-webpack.js:49:1)
at aurelia-loader-webpack.js:42:1
at new Promise (<anonymous>)
at __awaiter (aurelia-loader-webpack.js:38:1)
at WebpackLoader._import (aurelia-loader-webpack.js:186:1)
at WebpackLoader.<anonymous> (aurelia-loader-webpack.js:286:1)
at step (aurelia-loader-webpack.js:68:1)
at Object.next (aurelia-loader-webpack.js:49:1)
app.html
<template>
<h1>Hello World</h1>
<compose view-model.bind="viewModel"></compose>
</template>
app.ts
import { MyComponent } from "my-component";
export class App {
viewModel = MyComponent;
}
my-component.html
<template>Test</template>
my-component.ts
export class MyComponent {
}
@elitastic can you list the steps to reproduce the caching issue mentioned?
au new
cache: {
type: "filesystem",
buildDependencies: {
config: [__filename]
}
},
node_modules/.cache/webpack
@elitastic thanks, I'm able to see the errors, though I'm not sure what could be the cause. Totally unfamiliar with this class of issues. Are you able to help find a fix for it?
Issue is fixed. preserveModuleName
was not serialized on NormalModule
.
Fixes #199, I added dependency serializers, this adds support for filesystem cache in webpack 5.