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

Cannot find module 'core-js/modules/es.string.replace.js' #1182

Closed
hcancelik opened this issue Apr 1, 2024 · 5 comments
Closed

Cannot find module 'core-js/modules/es.string.replace.js' #1182

hcancelik opened this issue Apr 1, 2024 · 5 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@hcancelik
Copy link

hcancelik commented Apr 1, 2024

Currently getting the following error from this library

Cannot find module 'core-js/modules/es.string.replace.js' from 'node_modules/@googlemaps/url-signature/dist/index.umd.js'

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ..."): Library
  2. OS type and version: Node
  3. Library version and other environment information 3.3.42

Code example

const { Client } = require("@googlemaps/google-maps-services-js");

Stack trace

 Require stack:
        node_modules/@googlemaps/url-signature/dist/index.umd.js
        node_modules/@googlemaps/google-maps-services-js/dist/serialize.js
        node_modules/@googlemaps/google-maps-services-js/dist/directions.js
        node_modules/@googlemaps/google-maps-services-js/dist/client.js
        node_modules/@googlemaps/google-maps-services-js/dist/geolocate.js
        node_modules/@googlemaps/google-maps-services-js/dist/index.js

Thanks!

@hcancelik hcancelik added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 1, 2024
@wangela
Copy link
Member

wangela commented Apr 1, 2024

If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.

@hcancelik Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@hcancelik
Copy link
Author

Looking closely at the issue, this is related to the URL signature package.

There is an open ticket here, so I'm closing this one.

googlemaps/js-url-signature#528

@Politta
Copy link

Politta commented Apr 2, 2024

Shouldn't it have pinned dependencies to avoid issues like that going forward?

@TimJohns
Copy link

TimJohns commented Apr 5, 2024

Confirming, cross-posting, and summarizing some workarounds from the googlemaps/js-url-signature#528 issue thread, npm users can override the upstream js-url-signature version to the 1.0.32 version:

  "overrides": {
    "@googlemaps/url-signature": "1.0.32"
  }

Similarly it appears that users of other package managers (presumably pnpm or yarn) can use the following, but I have not personally confirmed:

"resolutions": {
  "@googlemaps/url-signature": "1.0.32"
}

Alternately, you could add "core-js" explicitly as a dev dependency (also confirmed works in our use case):

npm install core-js --save-dev

That said, these are essentially just temporary workarounds already suggested by others in the googlemaps/js-url-signature#528 issue thread that I am cross-posting here for convenience and confirming worked for my team -- but my own team's actual plan is to just wait a bit for a fix, so that we don't have to remember to pull these out when js-url-signature is presumably updated.

@3DGISKing
Copy link

same for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

5 participants