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

Mapilary-js cant be imported in React Router 7 (Vite 5.4.11) #623

Open
chanan opened this issue Dec 9, 2024 · 0 comments
Open

Mapilary-js cant be imported in React Router 7 (Vite 5.4.11) #623

chanan opened this issue Dec 9, 2024 · 0 comments

Comments

@chanan
Copy link

chanan commented Dec 9, 2024

Basic information

MapillaryJS version: "mapillary-js": "^4.1.2",
System/Browser: Mac OS, Node 22.11.0

Steps to Reproduce Behavior

  1. Create a project using react router 7 (Vite 5.4.11)
  2. Add mapillary-js
  3. Import { Viewer, ViewerOptions }
  4. Try to run project

Expected behavior

Project runs

Actual behavior

Internal server error: [vite] The requested module 'mapillary-js' does not provide an export named 'ViewerOptions'
      at analyzeImportedModDifference (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52053:15)
      at nodeImport (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:53060:5)
      at ssrImport (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52914:16)
      at eval (/Users/chanan/work/list_test_cli/maps/app/components/map/import.js:3:44)
      at instantiateModule (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52972:5)

Additional information

If the import is changed to only import Viewer then that too fails:

Internal server error: [vite] The requested module 'mapillary-js' does not provide an export named 'Viewer'
      at analyzeImportedModDifference (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52053:15)
      at nodeImport (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:53060:5)
      at ssrImport (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52914:16)
      at eval (/Users/chanan/work/list_test_cli/maps/app/components/map/index.tsx:7:31)
      at instantiateModule (file:///Users/chanan/work/list_test_cli/maps/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52972:5)
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

1 participant