Nitro bundling does not seem to convert the typescript decorator.
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v16.15.0
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
npm@8.3.0
- Builder:
vite
- User Config:
typescript
,app
,css
,build
,runtimeConfig
,vite
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://codesandbox.io/s/sleepy-mestorf-hh7edv?file=/server/utils/sequelize.ts
Describe the bug
I apologize for my poor English and use a translator.
If the source code includes a typescript decorator, the bundling of rollup does not end. I think it’s the same issue as the https://github.com/nuxt/framework/issues/5235 post.
Here are the results of the my nuxi dev
:
Vite client warmed up in 9811ms 00:02:29
Vite server warmed up in 430ms 00:02:31
Vite server built in 12457ms
I checked exactly where it stopped.
And the esbuild
rollup plugin used in the getRollupConfig
function in the node_modules/nitropack/dist/chunks/prerender.mjs
file does not seem to process files that use typescript decorators.
And I found out that the autoImport
plugin excluded files that are using decorators from the processing list.
One weird thing is, after the first nuxt app was created, it worked.
This issue occurred after deleting the node_modules
folder and reinstalling all packages.
I deleted the file node_modules
, .vite
, .nuxt
, package-lock.json
, and deleted the cache using the npm clean verify
command. Nevertheless, the problem has not been solved.
Also, after deleting the node_modules
folder and reinstalling the package, an explicit installation of the @nuxt/vite-builder
package was required. This was not required immediately after the app was created with the nuxi
command.
I’ve prepared minimal reproduction, but I don’t know how it’ll work.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Thanks for the followup @izure1. I’ve escalated this to https://github.com/nuxt/framework/issues/5371 and https://github.com/unjs/nitro/issues/273 for having an experimental flag for built-in support while ESBuild and Spec are stable.
Ah nice, thanks for the info, that’s awesome!
Anyways, regarding my report: I think then this problem is probably the same as https://github.com/nuxt/framework/issues/5899!
Sorry for the intrusion here ✋