Open vilnytskyi opened 1 year ago
According to the documentation of aurelia-bootstrapper
this package is meant to be used in a browser environment (see Platform Support). Did you try to use it without nodeIntegration: true
/contextIsolation: false
?
@johannesgiani yeah, in this case, it complains about the inability to find the require
function.
In fact, the current issue I stopped inspecting is strange webpack module identifiers in webpack runtime registry. When using default simple webpack config without electron-forge
, it registers npm packages as:
'aurelia-framework': () => module,
'aurelia-logging': () => module,
...
But for some reason webpack under forge's control registers them like:
'./node_modules/aurelia-framework/dist/index.js?someHashParams': () => module,
'./node_modules/aurelia-logging/dist/index.js?someHashParams': () => module,
...
And that's the reason aurelia-loader-webpack
fails to resolve these dependencies during bootstrap stage, as it has hard-coded dependencies name usages like loader.loadModule('aurelia-framework')
which then resolves to __webpack_require__('aurelia-framework')
that obviously won't work with the way modules are registered, as showcased above.
Pre-flight checklist
Electron Forge version
6.0.4
Electron version
22.0.3
Operating system
Windows 11 x64
Last known working Electron Forge version
No response
Expected behavior
The
aurelia-bootstrapper@latest
npm package should properly bootstrap Aurelia app in required conditions are met.Actual behavior
Aurelia Bootstrapper tries to resolve
aurelia-loader-webpack
module from<projectRoot>\.webpack\renderer\native_modules
but fails.Steps to reproduce
npm init electron-app@latest aurelia-app -- --template=webpack-typescript
src/index.ts
file and addnodeIntegration: true, contextIsolation: false
towebPreferences
config ofBrowserWindow
:src/renderer.ts
:Additional information
The following scenario works just fine when running development webpack bundle without Electron.