Trying to build a container using @adonisjs/fold
#4546
-
Hello, I'm trying to use You can find the code and reproduction in this repo (it's very simple): https://github.com/Barbapapazes/trying-adonisjs-fold After running ➜ nr build && NODE_DEBUG=adonisjs:fold node build/index.js
> @ build /Users/esteban/dev/barbapapazes/tmp/fold
> tsup-node
CLI Building entry: ./src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.0.2
CLI Using tsup config: /Users/esteban/dev/barbapapazes/tmp/fold/package.json
CLI Target: esnext
CLI Cleaning output folder
ESM Build start
ESM You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
ESM build/index.js 1015.00 B
ESM build/index.js.map 849.00 B
ESM ⚡️ Build success in 99ms
[class UserService] undefined
undefined
file:///Users/esteban/dev/barbapapazes/tmp/fold/node_modules/.pnpm/@[email protected]/node_modules/@adonisjs/fold/build/chunk-IGHHTAHI.js:294
async resolveFor(parent, binding, runtimeValues, createError = (message) => new RuntimeException2(message)) {
^
RuntimeException: Cannot construct "[class UserService]" class. Container is not able to resolve its dependencies. Did you mean to use @inject decorator
at createError (file:///Users/esteban/dev/barbapapazes/tmp/fold/node_modules/.pnpm/@[email protected]/node_modules/@adonisjs/fold/build/chunk-IGHHTAHI.js:294:79)
at #missingDependenciesException (file:///Users/esteban/dev/barbapapazes/tmp/fold/node_modules/.pnpm/@[email protected]/node_modules/@adonisjs/fold/build/chunk-IGHHTAHI.js:236:12)
at ContainerResolver.resolveFor (file:///Users/esteban/dev/barbapapazes/tmp/fold/node_modules/.pnpm/@[email protected]/node_modules/@adonisjs/fold/build/chunk-IGHHTAHI.js:365:49) {
status: 500,
code: 'E_RUNTIME_EXCEPTION'
}
Node.js v18.19.0 I also tried with Node.js v20.12.2. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think |
Beta Was this translation helpful? Give feedback.
I think
tsup-node
does not supportemitDecoratorsMetaData
flag and hence it is failing. So you either need to compile it viatsc
. Or usets-node
to make it work.