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

Defaulting module resolution to Node10 breaks types. #280

Closed
3 tasks done
Shakeskeyboarde opened this issue Oct 28, 2023 · 2 comments
Closed
3 tasks done

Defaulting module resolution to Node10 breaks types. #280

Shakeskeyboarde opened this issue Oct 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Shakeskeyboarde
Copy link

Shakeskeyboarde commented Oct 28, 2023

Describe the bug

When I updated to 3.6.1, I suddenly got type errors in my monorepo. I traced it back to one of my workspaces now having an emitted type defined as any, where previously in 3.6.0 it was a useful type.

After looking at the changes from 3.6.0 to 3.6.1, I saw that moduleResolution is now set to Node10 if not explicitly configured, overriding the typescript default.

My workaround is to explicitly set moduleResolution, in my case to NodeNext. However, this is going to trip a lot of people up. I believe that the change should be reverted and note added to the readme directing Vue users to explicitly set moduleResolution.

The current fix is fragile in that it affects all other ecosystems to solve a bug for one ecosystem. It will also need maintenance in the future as typescript and its configuration continue to evolve.

Reproduction

https://github.com/Shakeskeyboarde/vite-plugin-dts-bug

Steps to reproduce

Follow the steps in the README.md file of the repo above.

System Info

  System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1
    Memory: 69.50 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    npm: 10.1.0 - ~/.nvm/versions/node/v18.17.1/bin/npm
  Browsers:
    Chrome: 116.0.5845.179
    Safari: 17.0
  npmPackages:
    vite: ^4.5.0 => 4.5.0 
    vite-plugin-dts: ^3.6.2 => 3.6.2

Validations

@qmhc
Copy link
Owner

qmhc commented Oct 28, 2023

Could you try v3.6.2?

@Shakeskeyboarde
Copy link
Author

Still exist in 3.6.2. I've updated the description with a repro.

@qmhc qmhc added the enhancement New feature or request label Oct 30, 2023
@qmhc qmhc closed this as completed in a6f12dc Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants