nodegui/packer

Packed app won't run if there's a space in the file path

krage opened this issue · 3 comments

krage commented

Using version 1.1.2. Easy to reproduce on Windows, haven't checked if this is an issue elsewhere.

Starting in c:/temp:

git clone https://github.com/nodegui/nodegui-starter
cd nodegui-starter
npm install
npm install --save-dev @nodegui/packer
npm run-script build
npx nodegui-packer --init MyApp
npx nodegui-packer --pack dist
cd deploy/win32/build/MyApp
./qode

Above all works fine and hello world app appears. Now to introduce a space in the path:

cd ..
mv MyApp "MyApp with spaces"
cd "MyApp with spaces"
./qode

Errors out in console before managing to load:

internal/modules/cjs/loader.js:628
    throw err;
    ^

Error: Cannot find module 'C:/temp/nodegui-starter/deploy/win32/build/MyApp'
Require stack:
- internal/preload
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:939:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:392:5)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:53:3)
    at internal/main/repl.js:18:1 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]

Seems specific to packer since renaming parent to c:/temp/nodegui starter and running npx qode ./dist/index.js from there works fine.

I can confirm this issue. Can stably reproduce it with spaces in folder names in Windows OS

a7ul commented

Thanks for reporting @krage and @constgen . Will take a look on this when I clear up some more backlog. Any help appreciated.

a7ul commented

This should be fixed in the latest version of nodegui and qode.

Please reopen if it doesnt work for you.