-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Import error in production using Vite.js #99
Comments
This isn't an issue in Vite 4.0, so I'm going to close it :) |
I spoke too soon! This is still happening in Vite 4.0. |
I just encountered the same issue in native esbuild. error snapshots: |
Getting the same using Vite. Did anyone manage to resolve this? |
@eds123 In my case, I just imported // import ReactCompareImage from 'react-compare-image'
// replace by
const ReactCompareImage = require('react-compare-image') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for the great library! I’m seeing some weird behaviour when trying to bundle it with Vite using their
react-ts
template.To get a minimal reproduction, input the following into your terminal:
yarn create vite repro-demo --template react-ts cd repro-demo yarn yarn add react-compare-image
To get
react-compare-image
into the app, swap the existingsrc/App.tsx
with the following:At this point, you should be able to reproduce the error. Build and serve the app in your terminal:
When you open the app on http://localhost:4173/, you’ll see the following error:
Logging
ReactCompareImage
yields the following:It looks to me like the export type of
react-compare-image
is inconsistent between thedev
andbuild
workflows. Happy to provide more information if helpful.The text was updated successfully, but these errors were encountered: