leafac / caxa

📦 Package Node.js applications into executable binaries 📦
https://npm.im/caxa
697 stars 33 forks source link

TypeError: Class extends value undefined is not a constructor or null #69

Closed TheAjaykrishnanR closed 10 months ago

TheAjaykrishnanR commented 1 year ago

There is a nodejs project that i am trying to make a standalone windows executable of, it runs fine with: npm run start or node dist/bundle/start.js

Using caxa I try: npx caxa -i . -o "test.exe" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/dist/bundle/start.js"

which successfully creates test.exe, but open running the executable i'm met with:

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (E:\fosscord\fosscord-server\dist\util\entities\Config.js:24:59)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (E:\fosscord\fosscord-server\dist\util\util\Database.js:24:18)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)

I tried searching online for this error and seem to find references of "circular dependency" which i am not entirely familiar about. Apparently Database.js has: const Config_1 = require("../entities/Config");

Is there a way to fix this error since the app runs fine through node

leafac commented 10 months ago

Hi @AjaykrishnanR-axon,

Thanks for considering using caxa.

I’ve been thinking about the broad strategy employed by caxa and concluded that there is a better way to solve the problem. Can you please give it a try and see if it works for your case?

It’s a different enough approach that I think it deserves a new name, and it’s part of a bigger toolset that I’m building, which I call Radically Straightforward · Package.

I’m deprecating caxa and archiving this repository. I invite you to continue the conversation in Radically Straightforward’s issues.

Best.