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

Async imports behave differently in production and dev #1168

Closed
MartinMalinda opened this issue Nov 28, 2020 · 1 comment
Closed

Async imports behave differently in production and dev #1168

MartinMalinda opened this issue Nov 28, 2020 · 1 comment

Comments

@MartinMalinda
Copy link

MartinMalinda commented Nov 28, 2020

Describe the bug

const PhotoSwipe = await import('photoswipe'); // works in dev, fails in prod
const { default: PhotoSwipe } = await import('photoswipe'); // fails in dev, works in prod 

Previously before vite update I was using { default: PhotoSwipe } everywhere and that worked well

System Info

  • required vite version: 1.0.0-rc.13
  • required Operating System: MacOS
  • required Node version: 10.16
@underfin
Copy link
Member

underfin commented Dec 4, 2020

I tested it and it has same behavior both of dev and pord.

Maybe it caused by #837 and the cache of pervious optimizer vesion exists. You can use vite --force to resolve this.

@underfin underfin closed this as completed Dec 4, 2020
@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

2 participants