Skip to content
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

@nuxt/types should be a valid JS package (w/ an index.js) so that TS emitDecoratorMetadata works #9030

Closed
fabis94 opened this issue Mar 22, 2021 · 0 comments · Fixed by #9059

Comments

@fabis94
Copy link

fabis94 commented Mar 22, 2021

Versions

  • nuxt: 2.15.3
  • node: 14.15.4
  • typescript: 4.2.3

Reproduction

No reproduction, but I've shown an example and explained it here: microsoft/TypeScript#18008 (comment)

For more info on the entire issue and how emitDecoratorMetadata see the entire issue: microsoft/TypeScript#18008

Steps to reproduce

image

Create a TypeScript class in Nuxt.js that is decorated with a TS decorator & with emitDecoratorMetadata turned on, and have one of the constructor params be one of the types exported from @nuxt/types.

What is Expected?

The code should compile.

What is actually happening?

Since emitDecoratorMetadata: true leaves the import of @nuxt/types in JavaScript in the compiled build, webpack throws an error about not being able to resolve @nuxt/types, because the package doesn't have an index.js file.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants