Skip to content
\n

My directory:

\n
.\n├── Dockerfile\n├── app-out.cjs\n├── app-out.cjs.map\n├── package-lock.json\n├── package.json\n├── sea-config.json\n└── src\n    └── app.js\n
\n

It works fine if I keep the file app-out.cjs in the directory. But the functionality of source-map disappears if I delete the bundled source file.
\nThe condition conflict with my purpose because I want to delivery only the application without source code.

\n
rm app-out.cjs\n\n./app\nExpress server listening on port 3000\n(do something and throw an error)\n\nError: my error\n    at app-out.cjs:6464:9\n    at Layer.handle [as handle_request] (/usr/app/node_modules/express/lib/router/layer.js:95:5)\n    at next (/usr/app/node_modules/express/lib/router/route.js:137:13)\n    at Route.dispatch (/usr/app/node_modules/express/lib/router/route.js:112:3)\n    at Layer.handle [as handle_request] (/usr/app/node_modules/express/lib/router/layer.js:95:5)\n    at /usr/app/node_modules/express/lib/router/index.js:281:22\n    at Function.process_params (/usr/app/node_modules/express/lib/router/index.js:335:12)\n    at next (/usr/app/node_modules/express/lib/router/index.js:275:10)\n    at cors (/usr/app/node_modules/cors/lib/index.js:188:7)\n    at /usr/app/node_modules/cors/lib/index.js:224:17\n
\n

Could anyone give me some idea or advice?

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

There is currently no VFS/FS hooks support in Node.js in general. Effectively the SEA supports a main script and a list of assets, and it's up to the user how they can map the bundled assets and redirect fs calls (internal or user-land) to it (currently, they can only monkey-patch fs, until proper fs hooks are agreed upon and implemented by someone : #43). Internally, not being able to locate the file inside the SEA (as there's no VFS support) would just lead to missing source maps.

","upvoteCount":2,"url":"https://github.com/nodejs/single-executable/discussions/97#discussioncomment-9514188"}}}
Discussion options

You must be logged in to vote

There is currently no VFS/FS hooks support in Node.js in general. Effectively the SEA supports a main script and a list of assets, and it's up to the user how they can map the bundled assets and redirect fs calls (internal or user-land) to it (currently, they can only monkey-patch fs, until proper fs hooks are agreed upon and implemented by someone : #43). Internally, not being able to locate the file inside the SEA (as there's no VFS support) would just lead to missing source maps.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@louis222220
Comment options

Answer selected by louis222220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants