We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I ncc a fastify project with typeorm, run ncc build app.ts -o dist and like this
ncc build app.ts -o dist
$ npm run ncc > [email protected] ncc > ncc build app.ts -o dist ncc: Version 0.38.1 ncc: Compiling file index.js into CJS ncc: Using [email protected] (local user-provided) 0kB dist/file.js 1kB dist/worker-pipeline.js 1kB dist/worker.js 5kB dist/worker1.js 7024kB dist/index.js 7031kB [5705ms] - ncc 0.38.1
And try run node index.js
node index.js
$ node index.js node:internal/event_target:1088 process.nextTick(() => { throw err; }); ^ Error: Cannot find module './indexes' Require stack: - /Users/seepine/workspace/test-transfer/dist/worker1.js at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15) at Module._load (node:internal/modules/cjs/loader:985:27) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at Object.<anonymous> (/Users/seepine/workspace/test-transfer/dist/worker1.js:5:37) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) Emitted 'error' event on Worker instance at: at [kOnErrorMessage] (node:internal/worker:326:10) at [kOnMessage] (node:internal/worker:337:37) at MessagePort.<anonymous> (node:internal/worker:232:57) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:814:20) at exports.emitMessage (node:internal/per_context/messageport:23:28) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/seepine/workspace/test-transfer/dist/worker1.js' ] } Node.js v20.10.0
The text was updated successfully, but these errors were encountered:
Its hard to know without the source code. Usually this is caused by a dynamic require.
You can check in /Users/seepine/workspace/test-transfer/dist/worker1.js for something like require(str) and change it to require('./indexes') perhaps.
/Users/seepine/workspace/test-transfer/dist/worker1.js
require(str)
require('./indexes')
Sorry, something went wrong.
Hi, try index.ts
index.ts
import fastify from "fastify"; const server = fastify({}); server.listen({ host: "0.0.0.0", port: 3000 });
pnpm i fastify pnpm i @vercel/ncc -D
Add scripts to package.json
"ncc": "ncc build index.ts -o dist-ncc"
And run
pnpm ncc
@seepine Hi, Did you manage to figure this out? I'm experiencing the same issue.
No,i gave up on NCC.
No branches or pull requests
I ncc a fastify project with typeorm, run
ncc build app.ts -o dist
and like thisAnd try run
node index.js
The text was updated successfully, but these errors were encountered: