mapillary / mapillary/mapillary-js
Mapilary-js cant be imported in React Router 7 (Vite 5.4.11)
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 516
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
Basic information
MapillaryJS version: "mapillary-js": "^4.1.2",
System/Browser: Mac OS, Node 22.11.0
Steps to Reproduce Behavior
- Create a project using react router 7 (Vite 5.4.11)
- Add mapillary-js
- Import { Viewer, ViewerOptions }
- 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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure in the React Router 7 project, starting with the imports referenced in app/components/map/import.js and app/components/map/index.tsx. Inspect how mapillary-js exports are resolved by Vite's SSR path, then verify that the reported Viewer and ViewerOptions imports work in the stated setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, vite
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100