jiti
jiti copied to clipboard
Reflect.metadata is not a function
Environment
node v16.20.0 (npm v8.19.4)
Reproduction
Run npm audit fix within the Nuxt 2 project and try to build the app.
Describe the bug
The reflect-metadata dependency is missing.
Additional context
I was able to solve this issue by adding the reflect-metadata dependency to my project and importing it. It seems that this is related to the v1.17.2 patch, specifically the addition of support to emit decorator metadata (https://github.com/unjs/jiti/pull/119). My suspicion is that reflect-metadata should not be included in the dev dependencies.
Logs
FATAL Reflect.metadata is not a function