We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps:
Reproduce it here: https://replit.com/join/qyvahtyiuq-fc14
Or refer to this code snippet:
import React from 'react'; import MapboxGeocoder from '@mapbox/mapbox-gl-geocoder'; import './App.css'; function App() { new MapboxGeocoder({ accessToken: '', mapboxgl: '', marker: false, }); return ( <main> React⚛️ + Vite⚡ + Replit🌀 </main> ); } export default App;
Current:
Uncaught TypeError: EventEmitter is not a constructor at new MapboxGeocoder (index.js?b9d5:43) ...
Expected: No error
Seems like this is because I'm using vite as this worked previously. events is also not listed as a dependency.
events
Temporary workaround: Install events
pnpm install events @types/events
The text was updated successfully, but these errors were encountered:
Same issue, @fc thanks for the workaround
Sorry, something went wrong.
So the problem is that mapbox-gl-geocoder needs to specify events as a dep? But then why would it work outside vite?
mapbox-gl-geocoder
vite
Vite doesn't natively do the Node emulation that other bundlers do. See Parcel docs for these examples: https://parceljs.org/features/node-emulation/
This is still our bug—per say. We should include https://www.npmjs.com/package/events in the dependencies.
Thanks!
Successfully merging a pull request may close this issue.
Steps:
Reproduce it here:
https://replit.com/join/qyvahtyiuq-fc14
Or refer to this code snippet:
Current:
Expected:
No error
Seems like this is because I'm using vite as this worked previously.
events
is also not listed as a dependency.Temporary workaround:
Install
events
The text was updated successfully, but these errors were encountered: