codesbiome / electron-react-webpack-typescript-2024

Electron React Webpack Typescript Boilerplate with Custom Window and Titlebar Menus.
MIT License
354 stars 78 forks source link

When I install a new module, just use it, Electron crashes #34

Closed enriqueggalvez closed 2 years ago

enriqueggalvez commented 2 years ago

I have installed your magnificent boilerplate following the steps you indicate.

So I wanted to use the "ini" module to read .ini files I had to install:

npm  install  ini
npm install @types/ini

and added it to my app.tsx: import ini from 'ini'

So far so good.

But when i use the ini class, Electron crash with a:

App threw an error during load
Error: Module build failed (from ./node_modules/@marshallofsound/webpack-asset-relocator-loader/dist/index.js):
SyntaxError: Unexpected token (189:12)
    at module.exports.pp$4.raise (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:20834:13)
    at module.exports.pp.unexpected (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:18680:8)
    at module.exports.pp$1.parseTryStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:19069:49)
    at module.exports.pp$1.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:18834:32)
    at _class.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:4539:118)
    at _class.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:42314:22)
    at module.exports.pp$1.parseBlock (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:19157:23)
    at module.exports.pp$1.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:18841:34)
    at _class.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:4539:118)
    at _class.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:42314:22)
    at module.exports.pp$1.parseIfStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:18981:26)
    at module.exports.pp$1.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:18830:31)
    at _class.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:4539:118)
    at _class.parseStatement (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:42314:22)
    at module.exports.pp$1.parseBlock (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:19157:23)
    at module.exports.pp$3.parseFunctionBody (D:\PROYECTOS\Electron\Fracture2\node_modules\@marshallofsound\webpack-asset-relocator-loader\dist\index.js:20675:22)
    at ./node_modules/ini/lib/ini.js (D:\PROYECTOS\Electron\Fracture2\.webpack\main\index.js:903:7)
    at __webpack_require__ (D:\PROYECTOS\Electron\Fracture2\.webpack\main\index.js:1167:41)
    at D:\PROYECTOS\Electron\Fracture2\.webpack\main\index.js:1226:61
    at D:\PROYECTOS\Electron\Fracture2\.webpack\main\index.js:1279:3
    at Object.<anonymous> (D:\PROYECTOS\Electron\Fracture2\.webpack\main\index.js:1282:12)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1175:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
codesbiome commented 2 years ago

Thank you for notifying us about this @enriqueggalvez We are already working onto fixing issue and releasing new changes with an update soon.

codesbiome commented 2 years ago

@enriqueggalvez

Give it a try with new version v7.0.0 of this project. We've made some changes for fixing this issue also.