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

Error importing with Vite #94

Open
cesargdm opened this issue Nov 5, 2022 · 8 comments
Open

Error importing with Vite #94

cesargdm opened this issue Nov 5, 2022 · 8 comments

Comments

@cesargdm
Copy link

cesargdm commented Nov 5, 2022

If using vite, import cannot be possible.

Failed to resolve entry for package "react-mapkit". The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:import-analysis
@jakedarby24
Copy link

@cesargdm I've been having the same problem when importing with yarn. Think I've found a temporary fix:
Go to /node_modules/react-mapkit/package.json. Change line 23 to "module": "dist/react-mapkit.cjs.production.min.js",. This seemed to fix it for me, and now the import works and I can get the map to display.

@bnussman
Copy link

bnussman commented Aug 12, 2023

No issues with Vite here! Here's my repo if that helps: https://github.com/bnussman/beep/tree/main/website

@doubleforte
Copy link

Having the same issue with Vite v4.4.9.

Failed to resolve entry for package "react-mapkit". The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:import-analysis

@chrisdrackett
Copy link
Owner

I'm not familiar with vite, so I'm not sure whats up. Did anyone check out @bnussman's repo?

@doubleforte
Copy link

Vite is a replacement for the dead/dying create-react-app. It's gaining lots of popularity.

I looked at @bnussman's repo. Looks like they are using a different package (mapkit-react vs react-mapkit)

https://github.com/bnussman/beep/blob/39849cb8fe6e8912d9b11ded1bcdb87707cfe758/website/package.json#L25

I've made a very simple project using Vite and react-mapkit to demonstrate the issue. Clone and run (instructions in the README) and you'll see the crash.

https://github.com/doubleforte/mapkit-example

@bnussman
Copy link

OMG!! I'm so sorry

@chrisdrackett
Copy link
Owner

I hope to look at this soon, but until my kids are back at school my free time has been less than ideal :)

@doubleforte
Copy link

Any progress on this one?

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

No branches or pull requests

5 participants