Skip to content

Conversation

@FossPrime
Copy link
Contributor

@FossPrime FossPrime commented Dec 9, 2021

Summary

Vite 2.7.0 users are getting @feathersjs/vuex is incorrectly packaged. Please contact the package author to fix.
vitejs/vite#6013
Screenshot from 2021-12-08 15-08-53

This provides a fix by declaring that we export ESM. The main is still technically incorrect, but that's harder to fix as we use Typescript and they haven't released Node Native ESM support as of TS 4.5.
The same fix works on 4.0.1-pre.7, which someone forgot to tag in GH

Sandbox

https://stackblitz.com/edit/feathersjs-wy4w68?file=vuex-package.json

Risks

  • Declaring exports makes Node block access to undeclared entry points
  • I've only tested this on one environment... I'd let it simmer for a week. Unless you're pushing to the alpha... in which case...

Alternative solutions

  • change the extension of the main script to .mjs
  • Change the package.json/type to "module" (could break tests, debugging, typescript linting etc)

Sources

https://nodejs.org/api/packages.html#conditional-exports

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

Successfully merging this pull request may close these issues.

1 participant