-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
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
Nitro bundling does not seem to convert the typescript decorator. #14080
Comments
this seems to make sense, i also use decorators for the package |
@djschilling I solved the problem by adding the following settings.
And in the
However, it would be better if the typescript decorator is supported by nuxt3 by default. |
We use ESBuild to transform typescript files both with Vite and Nitro. Last update for decorator support: evanw/esbuild#104 (comment) I think adding rollup plugin would be the best. |
Upstream issue created: |
Thanks for the followup @izure1. I've escalated this to #14126 and nitrojs/nitro#273 for having an experimental flag for built-in support while ESBuild and Spec are stable. |
@izure1 thanks for the tip. Now its at least throwing an error.
Did you also get this error? |
@djschilling In my case, I used the |
Brief update: The fix of @izure1 worked out in RC2-RC4, with RC5 it stopped working and we get the error from above again: start Building server... nitro 12:48:20
WARN Multiple major versions of package parse5 are being externalized. Picking latest version. 12:48:28
- app/node_modules/cli-highlight/node_modules/[email protected]
- app/node_modules/[email protected]
ERROR Rollup error: Could not load /app/.nuxt/dist/server/server.mjs (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.mjs): ENOENT: no such file or directory, open '/app/.nuxt/dist/server/server.mjs'
ERROR Could not load /app/.nuxt/dist/server/server.mjs (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.mjs): ENOENT: no such file or directory, open '/app/.nuxt/dist/server/server.mjs' |
@BracketJohn Since rc.4 version and later, TypeScript Decorator is supported by default, so you no longer need to use the plugin. |
Ah nice, thanks for the info, that's awesome! Anyways, regarding my report: I think then this problem is probably the same as #14320! Sorry for the intrusion here ✋ |
TODO: try rollup plugin mentioned in https://github.com/nuxt/framework/issues/5299
Environment
Windows_NT
v16.15.0
3.0.0-rc.3
[email protected]
vite
typescript
,app
,css
,build
,runtimeConfig
,vite
-
-
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 #14062 post.
Here are the results of the my
nuxi dev
:I checked exactly where it stopped.
And the
esbuild
rollup plugin used in thegetRollupConfig
function in thenode_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 thenpm 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 thenuxi
command.I've prepared minimal reproduction, but I don't know how it'll work.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: