Skip to content

Declarations broken under Vite when upgrading @vitejs/plugin-vue to v1.8 #285

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

Closed
mseele opened this issue Oct 8, 2021 · 3 comments
Closed
Labels
kind: support Asking for support with something or a specific use case problem: stale Issue has not been responded to in some time scope: integration Related to an integration, not necessarily to core (but could influence core) scope: Vite Related to integration with Vite, not Rollup, which this plugin was designed for scope: vue Related to integration with Vue (rollup-plugin-vue is long archived), not core solution: out-of-scope This is out of scope for this project

Comments

@mseele
Copy link

mseele commented Oct 8, 2021

What happens and why it is wrong

After updateing @vitejs/plugin-vue version typescript generation via rollup-plugin-typescript2 is broken.
Using version 1.7.1 of @vitejs/plugin-vue the generation via rollup-plugin-typescript2 works like expected.

From version 1.8.0 it does not longer generate type definitions for components but list them in the index.d.ts file.

Reproduction

  • Checkout https://github.com./mseele/vite-typescript2-output-broken, run yarn install and then yarn build
  • In the dist directory a index.d.ts file will be generated with the reference to ./components/Hello.vue
  • The ./components/Hello.vue.d.ts file will not be generated
  • Change @vitejs/plugin-vue in package.json to 1.7.1, run yarn install and then yarn build again
  • Everything works as expected: the missing ./components/Hello.vue.d.ts file has been generated

See also

Please see vitejs/vite#5044 i've opened in vite repo

@zeusdeux
Copy link

zeusdeux commented Nov 3, 2021

Would the ordering make a difference, i.e., moving rpt2 above vue? I'd think vue is stripping away types before source is fed to rpt2

@agilgur5 agilgur5 added the scope: integration Related to an integration, not necessarily to core (but could influence core) label Apr 24, 2022
@agilgur5 agilgur5 changed the title Typescript generation is broken under vite Declaration s broken under vite Apr 24, 2022
@agilgur5 agilgur5 changed the title Declaration s broken under vite Declarations broken under Vite when upgrading plugin-vue to 1.8 Apr 24, 2022
@agilgur5
Copy link
Collaborator

Reading this issue and the one in Vite, as well as its linked issues, it sounds very much like a regression in Vite with the root cause already found there.

Will be closing this as out-of-scope then, but let us know if this needs reopening down the line if contraindicating info pops up.

@agilgur5 agilgur5 added kind: support Asking for support with something or a specific use case solution: out-of-scope This is out of scope for this project labels Apr 24, 2022
@agilgur5
Copy link
Collaborator

Per the upstream issue, seems like this was fixed in vitejs/vite#7909 and released in @vitejs/plugin-vue v3.0.0-alpha.0

@agilgur5 agilgur5 changed the title Declarations broken under Vite when upgrading plugin-vue to 1.8 Declarations broken under Vite when upgrading @vitejs/plugin-vue to 1.8 Jul 30, 2022
@agilgur5 agilgur5 changed the title Declarations broken under Vite when upgrading @vitejs/plugin-vue to 1.8 Declarations broken under Vite when upgrading @vitejs/plugin-vue to v1.8 Jul 30, 2022
@agilgur5 agilgur5 added the problem: stale Issue has not been responded to in some time label Jul 30, 2022
@agilgur5 agilgur5 added scope: vue Related to integration with Vue (rollup-plugin-vue is long archived), not core scope: Vite Related to integration with Vite, not Rollup, which this plugin was designed for labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: support Asking for support with something or a specific use case problem: stale Issue has not been responded to in some time scope: integration Related to an integration, not necessarily to core (but could influence core) scope: Vite Related to integration with Vite, not Rollup, which this plugin was designed for scope: vue Related to integration with Vue (rollup-plugin-vue is long archived), not core solution: out-of-scope This is out of scope for this project
Projects
None yet
Development

No branches or pull requests

3 participants