question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nitro bundling does not seem to convert the typescript decorator.

See original GitHub issue

Environment

  • 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:closed
  • Created a year ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pi0commented, Jun 9, 2022

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.

0reactions
BracketJohncommented, Jul 15, 2022

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 ✋

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nitro bundling does not seem to convert the typescript decorator ...
One weird thing is, after the first nuxt app was created, it worked. This issue occurred after deleting the node_modules folder and reinstalling...
Read more >
Typescript | Decorator doesn't seem to be registering properly
I am trying to make a simple decorator which you can specify what type of input a control is or select options etc,...
Read more >
Untitled
Notary stamp staples, Couple t shirts images, Zanetti francesca medico, ... Soiuri de varza cu frunza subtire, Daaru pila do mp3 song, Dhdreamleague, ......
Read more >
nitro type garage editor - Adventure İstanbul
In doing so, I encountered my first error. I'm currently in the middle of learning about lvalues and rvalues and was experimenting a...
Read more >
Converting TypeScript decorators into static code! - Medium
We want to take our expressive decorator-heavy code, and transform it into something else at build time.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found