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

Types exports in package.json are wrong #252

Closed
4 tasks done
RebeccaStevens opened this issue Mar 27, 2023 · 0 comments · Fixed by #253
Closed
4 tasks done

Types exports in package.json are wrong #252

RebeccaStevens opened this issue Mar 27, 2023 · 0 comments · Fixed by #253
Labels
Status: Review Needed Request for review comments

Comments

@RebeccaStevens
Copy link
Contributor

Reporting a bug?

Type info cannot be loaded correctly when using moduleResolution "bundler" or "node16".

Expected behavior

Types should work.

Reproduction

Set "moduleResolution": "bundler" or "moduleResolution": "node16" in the tsconfig file.

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: Linux 5.10 Ubuntu 21.04 (Hirsute Hippo)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 20.17 GB / 25.00 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.local/share/pnpm/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
  npmPackages:
    vite: 4.2.1 => 4.2.1 
    vue: 3.2.47 => 3.2.47 
    vue-i18n: 9.3.0-beta.17 => 9.3.0-beta.17

Screenshot

No response

Additional context

The types field needs to come first.

https://github.com/intlify/bundle-tools/blob/a7125968dd70c82ee030d47fb28b5d1553d02576/packages/unplugin-vue-i18n/package.json#LL69-L73C7

Why? Because when resolving an import, node looks for the first match, not the best match. Note: This is also the reason why "default" needs to be last.

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant