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

Fails to generate types every second run (when types are already in dist directory) #254

Closed
3 tasks done
dlitsman opened this issue Jul 29, 2023 · 5 comments
Closed
3 tasks done

Comments

@dlitsman
Copy link

Describe the bug

When dist directory already has types, vite-plugin-dts removes existing types but fails to generate new ones. It seems similar to #203 however I can still repro on 3.3.1. So I guess not duplicate as different major version and based on comments it should be fixes in 3.0

Screen.Recording.2023-07-29.at.01.17.44.mov

Reproduction

https://github.com/dlitsman/react-wake-lock/tree/feature/vite-build

Steps to reproduce

  1. git clone git@github.com:dlitsman/react-wake-lock.git
  2. cd react-wake-lock
  3. git checkout feature/vite-build
  4. npm install
  5. npm run build (success, types generated)
  6. npm run build (again, removes types and no new types created)

System Info

System:
    OS: macOS 13.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 523.84 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.4.0 - ~/.nvm/versions/node/v20.4.0/bin/node
    npm: 9.7.2 - ~/.nvm/versions/node/v20.4.0/bin/npm
  Browsers:
    Chrome: 115.0.5790.114
    Safari: 16.5.1
  npmPackages:
    vite: ^4.4.7 => 4.4.7 
    vite-plugin-dts: ^3.3.1 => 3.3.1

Validations

@qmhc qmhc added pending Need further confirmation bug Something isn't working and removed pending Need further confirmation labels Jul 29, 2023
@qmhc qmhc closed this as completed in 284c77f Jul 30, 2023
@qmhc qmhc added help wanted Extra attention is needed and removed bug Something isn't working labels Aug 12, 2023
@qmhc qmhc reopened this Aug 12, 2023
@qmhc qmhc added the bug Something isn't working label Aug 12, 2023
@qmhc
Copy link
Owner

qmhc commented Aug 12, 2023

The previous fix broke the generation of map files, so I decided to revert the previous fix and seek an alternative solution.

Therefore, I reopened the issue.

You can use version 3.5.1 to bypass this issue temporarily (but it cannot generate map files).

@qmhc qmhc removed bug Something isn't working help wanted Extra attention is needed labels Aug 12, 2023
@qmhc
Copy link
Owner

qmhc commented Aug 12, 2023

It's due to TypeScript version. In the latest version it seems that the issue has been resolved.

See #260 (comment).

@qmhc qmhc closed this as completed Aug 12, 2023
@thiemok
Copy link

thiemok commented Nov 11, 2023

I'm still seeing this issue, or a similar issue, with version 3.6.3. My logs indicate that typescript 5.0.4 is used, which the linked comment suggests as a potential cause for the issue. Am I maybe missing something?

@qmhc
Copy link
Owner

qmhc commented Nov 11, 2023

@thiemok You can try to provide a minimum reproduction and create a new issue.

@thiemok
Copy link

thiemok commented Nov 11, 2023

The issue is frankly very intermittent for me and I was able to avoid it by downgrading to 3.5.1. Before I dive into trying to get it reproduced consistently, can you confirm that typescript 5.0.4 being used by the plugin is expected behavior on version 3.6.3?

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

No branches or pull requests

3 participants