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

date-fns does not provide an export named 'default' when imported in specific order with @material-ui/pickers #1847

Closed
hmaurer opened this issue Feb 2, 2021 · 0 comments

Comments

@hmaurer
Copy link

hmaurer commented Feb 2, 2021

Describe the bug

When the packages date-fns@2.16.1 and @material-ui/pickers@4.0.0-alpha.12 are used and date-fns is imported before @material-ui/pickers/adapter/date-fns, the following error is observed:

Uncaught SyntaxError: The requested module '/node_modules/.vite/date-fns.js?v=cf140b8b' does not provide an export named 'default'

If date-fns is imported after @material-ui/pickers/adapter/date-fns, no error is observed.

Reproduction

https://gist.github.com/hmaurer/b6dd7048a1544d7190d42e48f130d30d

git clone git@gist.github.com:b6dd7048a1544d7190d42e48f130d30d.git vite-issue-1847
cd vite-issue-1847
npm i && npm run dev

Open http://localhost:3000. You should observe the following error in the web console:

Uncaught SyntaxError: The requested module '/node_modules/.vite/date-fns.js?v=cf140b8b' does not provide an export named 'default'

Now, in main.js, swap the order of imports of date-fns and @material-ui/pickers/adapter/date-fns, run rm -r node_modules/.vite and then npm run dev. You shouldn't observe an error in the console anymore.

System Info

  • vite version: 2.0.0-beta.61
  • Operating System: MacOS Catalina 10.15.7
  • Node version: v12.18.4
  • Package manager (npm/yarn/pnpm) and version: NPM 6.14.6
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant