bootstrapper icon indicating copy to clipboard operation
bootstrapper copied to clipboard

Bootstrapper doesn't work with Electron Forge

Open vilnytskyi opened this issue 3 years ago • 1 comments

I'm submitting a bug report

  • Library Version: 2.4.0

  • Operating System: Windows 11

  • Node Version: 18.13.0

  • NPM Version: 8.9.13
  • Webpack Version webpack 5.75.0

  • Browser: Electron 22.0.3

  • Language: TypeScript 4.5.5

Current behavior: Bootstrapper tries to resolve aurelia-loader-webpack module from <projectRoot>\.webpack\renderer\native_modules but fails.

Expected/desired behavior: Bootstrapper should properly bootstrap Aurelia app after it's imported in renderer script.

Steps to reproduce

  1. Create a new Electron app using Webpack+Typescript Electron Forge template:
npm init electron-app@latest aurelia-app -- --template=webpack-typescript
  1. Install aurelia bootstrapper package:
npm install aurelia-bootstrapper
  1. Import the installed package in src/renderer.ts:
import 'aurelia-bootstrapper'
  1. Run the application:
npm run start

vilnytskyi avatar Jan 22 '23 16:01 vilnytskyi

If bootstrapper is causing issues, one can try to temporarily work around it by bootstrapping the application oneself.

// main.js
import { Aurelia } from 'aurelia-framework';

export function startApplication() {
  const au = new Aurelia();
  au.use
    .plugin(...)
    .globalResources(...)
    .start()
    .then(() => au.setRoot(...))
}

startApplication();

bigopon avatar Jan 31 '23 23:01 bigopon