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

require is undefined #76

Open
ng-druid opened this issue Nov 23, 2022 · 5 comments
Open

require is undefined #76

ng-druid opened this issue Nov 23, 2022 · 5 comments
Assignees

Comments

@ng-druid
Copy link

Hello,

I have been working through an upgrade from agm maps to ng maps. The error below makes sense to me since require is meant to be used on the server not browser. On the browser import should be used. What am I missing…

Thanks

Screen Shot 2022-11-23 at 3 15 30 PM

@DaSchTour DaSchTour self-assigned this Nov 24, 2022
@DaSchTour
Copy link
Contributor

@ng-druid can you try with a newer version of the package or provide more information about your setup

@ng-druid
Copy link
Author

ng-druid commented Jan 5, 2023

@DaSchTour require() is also being used inside agm-maps which is what has been working fine prior to upgrading to ng-maps.

Screen Shot 2023-01-05 at 4 11 10 PM

@DaSchTour
Copy link
Contributor

Can you try with the newest version? It doesn't use require anymore but the new import.

@ng-druid
Copy link
Author

ng-druid commented Jan 6, 2023

@DaSchTour I switched to the newest version. Now receive another error.

Screen Shot 2023-01-06 at 11 59 00 AM

Screen Shot 2023-01-06 at 11 58 38 AM

@ng-druid
Copy link
Author

ng-druid commented Jan 6, 2023

@DaSchTour The SnazzyInfoWindow class is the default export of the snazy-info-window package.

new elems[0].default(options)

Docs for referencing the default export using import.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import

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

2 participants