Error triggered using mailer and any template adapter combined with a custom webpack.config.js, reporting that dist/css_inline_bg.wasm not found. #1095
Describe the bug
When I use a custom webpack.config.js to build the nestjs bundle and start with node dist/main.js, the app reports an error and exit immediately:
Error: ENOENT: no such file or directory, open 'C:\Users\xxx\Documents\Project\xxx-worker\dist\css_inline_bg.wasm'
at Object.openSync (node:fs:581:18)
at Object.readFileSync (node:fs:457:35)
at Object.__decorate (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:473906:54)
at __webpack_require__ (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:550543:42)
at Object.<anonymous> (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:472238:22)
at __webpack_require__ (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:550543:42)
at Object.<anonymous> (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:59790:23)
at __webpack_require__ (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:550543:42)
at Object.defineProperty.value (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:10:22)
at __webpack_require__ (C:\Users\xxx\Documents\Project\xxx-worker\dist\main.js:550543:42) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\xxx\\Documents\\Project\\xxx-worker\\dist\\css_inline_bg.wasm'
}
This will happen if I use anyone of the template, e.g.:
Describe the bug When I use a custom
webpack.config.js
to build thenestjs
bundle and start withnode dist/main.js
, the app reports an error and exit immediately:This will happen if I use anyone of the template, e.g.:
then create a
webpack.config.js
:and then modify
package.json
:and then
If I run
node dist/main.js
, the error is triggered.Expected behavior None of the errors should be printed.
Desktop (please complete the following information):
Additional context If I remove the template, everything goes fine.