Reflect Metadata wasnt imported into production build
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v18.6.0
- Nuxt Version:
3.0.0-rc.8
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
modern
,alias
,css
,runtimeConfig
,httpApi
,modules
,buildModules
,vite
,build
,intlify
- Runtime Modules:
@pinia/nuxt@0.3.1
,./modules/uikit
,./api/module
,@vueuse/nuxt@8.9.4
- Build Modules:
floating-vue/nuxt
Reproduction
I was using reflect-metdata
in global middleware in nuxt-rc6 and it was working perfectly. After upgrade to rc8 i face issue after production build (using nuxt build
) and nuxi preview
i see next error:
[nuxt] [request error] [unhandled] [500] Reflect.getMetadata is not a function
Describe the bug
I was using reflect-metdata
in global middleware in nuxt-rc6 and it was working perfectly. After upgrade to rc8 i face issue after production build (using nuxt build
) and nuxi preview
i see next error:
[nuxt] [request error] [unhandled] [500] Reflect.getMetadata is not a function
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Reflect.defineMetadata is not a ...
I had this issue for the Elastic APM RUM agent in Angular 7.1.4. The fix was the same: In Polyfills.ts i added import...
Read more >polyfills possible breaks reflect-metadata · Issue #62
The problem is, that the reflect polyfill in this library is not compatible with the original one. I could fix this by importing...
Read more >reflect-metadata
Start using reflect-metadata in your project by running `npm i ... Defining new metadata-producing decorators should not be arduous or ...
Read more >babel-plugin-transform-typescript-metadata
Babel plugin to emit decorator metadata like typescript compiler ... allows advanced reflection patterns when combined with Reflect.metadata output.
Read more >Decorators
With the introduction of Classes in TypeScript and ES6, there now exist certain ... import "reflect-metadata"; const formatMetadataKey = Symbol("format"); ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dmitryT93 yeah, you need to make dummy check for import
After this change builder works properly and dont treeshake it
Please see instead https://github.com/nuxt/framework/issues/2561#issuecomment-1233047751.