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

1.0.33 release requires core-js but states no dependency #528

Open
iamcdonald opened this issue Apr 1, 2024 · 28 comments
Open

1.0.33 release requires core-js but states no dependency #528

iamcdonald opened this issue Apr 1, 2024 · 28 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

@iamcdonald
Copy link

We're currently using @googlemaps/google-maps-services-js which has the following dependency on this module

{
  "dependencies": {
    "@googlemaps/url-signature": "^1.0.4",
    ...
  }
}

Unfortunately it would appear that changes to the build process for this module have manifested in the latest release (1.0.33) dist/index.umd.js requiring imports from core-js.

We're currently working around the issue by using npm overrides but I was wondering if it was intentional that core-js hadn't been added to dependencies or peerDependencies for this module.

@iamcdonald iamcdonald 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.

@iamcdonald 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

core-js is actually listed on the devDependencies but we are also getting the same issue.

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

const { Client } = require("@googlemaps/google-maps-services-js");
 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

@segovia-no
Copy link

Same issue here, using the @googlemaps/google-maps-services-js dependency in our projects results into an unmet dependency within this @googlemaps/url-signature repo, output is the same as the comment above.

@victororozco
Copy link

Same issue here, we fixed it temporarily using:

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

@vitorsilvalima
Copy link

vitorsilvalima commented Apr 1, 2024

have the same issue here

2024-04-01T20:08:31.857Z	undefined	ERROR	Uncaught Exception 	{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'core-js/modules/es.string.replace.js'\nRequire stack:\n- /var/task/node_modules/@googlemaps/url-signature/dist/index.umd.js\n- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/serialize.js\n- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/directions.js\n- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/client.js\n- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/geolocate.js\n- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/index.js\n- /var/task/src/features/menu/handlers/index.js\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module 'core-js/modules/es.string.replace.js'",
        "Require stack:",
        "- /var/task/node_modules/@googlemaps/url-signature/dist/index.umd.js",
        "- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/serialize.js",
        "- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/directions.js",
        "- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/client.js",
        "- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/geolocate.js",
        "- /var/task/node_modules/@googlemaps/google-maps-services-js/dist/index.js",
        "- /var/task/src/features/menu/handlers/index.js",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:1087:17)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)",
        "    at async start (file:///var/runtime/index.mjs:1282:23)",
        "    at async file:///var/runtime/index.mjs:1288:1"
    ]
}

@viniciusreiss
Copy link

same problem here

@reinel-panita
Copy link

Same problem for me

@Politta
Copy link

Politta commented Apr 2, 2024

Same issue for us:

Apr  2 02:00:57 ip-172-31-28-96 web[3162]: Error: Cannot find module 'core-js/modules/es.string.replace.js'
.
.
.
Apr  2 02:00:57 ip-172-31-28-96 web[3162]:    at Module._load (node:internal/modules/cjs/loader:960:12) {
Apr  2 02:00:57 ip-172-31-28-96 web[3162]:  code: 'MODULE_NOT_FOUND',
Apr  2 02:00:57 ip-172-31-28-96 web[3162]:  requireStack: [
Apr  2 02:00:57 ip-172-31-28-96 web[3162]:    '/var/app/current/node_modules/@googlemaps/url-signature/dist/index.umd.js',

@chrysanthosDsq
Copy link

Same issue for us

1 similar comment
@zhiwei-homage
Copy link

Same issue for us

@ogurashi
Copy link

ogurashi commented Apr 2, 2024

same issue here

@chargome
Copy link

chargome commented Apr 2, 2024

Same issue here, we fixed it temporarily using:

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

for npm users the equivalent is

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

@segovia-no
Copy link

For the ones that are using npm versions older than 8.3 that doesn't have support for overrides, you can use the package npm-force-resolutions to override this bricked version of url-signature.

@tgreco
Copy link

tgreco commented Apr 2, 2024

I added the resolutions to my package.json but still seeing an issue getting this to work with yarn.

@swapnil-webonise
Copy link

Same issue for us also

@stephkoltun
Copy link

stephkoltun commented Apr 3, 2024

This is also happening for us. Using npm overrides also didn’t solve the issue even though we use npm 9. Has anyone successfully worked around this?

@hcancelik
Copy link

This is also happening for us. Using npm overrides also didn’t solve the issue even though we use npm 9. Has anyone successfully worked around this?

You can just add core-js to your project npm install core-js

@Exac
Copy link

Exac commented Apr 3, 2024

For those who were unable to fix this by installing core-js in your project, you may also have to import core-js.

// package.json
{
  "dependencies": {
    "core-js": "^3.36.1",
  }
}
// node_entry.ts
require('core-js');

@cristiannietodev91
Copy link

using npm overrides works for me. you could check that node_modules/@googlemaps/url-signature is using version1.0.32 in package-lock.json and not 1.0.33

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

@daxaxelrod
Copy link

daxaxelrod commented Apr 24, 2024

Same here, how this happened to me is that my project uses "@googlemaps/google-maps-services-js@npm:3.3.34" which has a liberal dependency to "@googlemaps/url-signature": ^1.0.4

The recent version bump killed the install. @jpoehnelt

@zackdotcomputer
Copy link
Contributor

So the issue here appears to be one of an incorrect polyfill in the .umd.js build product. It appears to be the result of an interaction between corejs, babel, and the caniuse-lite database. However, the bug itself is in caniuse - the other two are behaving correctly based on what it is saying.

This was introduced by the babel update that happened between releases 1.0.32 and 1.0.33, which cascaded through to cause a caniuse update as well. Thankfully, it is fixed with the most recent caniuse release, so I was able to fix the issue by updating that dependency to latest in the lockfile. The PR to do so is here: #548

Unfortunately, this update needs to happen in this repository because the incorrect polyfill is baked in at build-time, so the only fix downstream until Google releases an update is to continue using overrides or resolutions to lock this library at 1.0.32.

@diego-santacruz
Copy link

I just stumbled upon this problem after updating packages. I temporarily fixed this using the suggested npm overrides, but it would be nice if a new version of @googlemaps/url-signature was built and released now that the upstream problem is solved.

@TimJohns
Copy link

This issue appears to still occur in my environment with the 1.0.35 release:

Error: Cannot find module 'core-js/modules/es.string.replace.js'
Require stack:
- /Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/url-signature/dist/index.umd.js
- /Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/google-maps-services-js/dist/serialize.js
- /Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/google-maps-services-js/dist/directions.js
- /Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/google-maps-services-js/dist/client.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at /Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/url-signature/dist/index.umd.js:1:79
    at Object.<anonymous> (/Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/url-signature/dist/index.umd.js:1:807)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/url-signature/dist/index.umd.js',
    '/Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/google-maps-services-js/dist/serialize.js',
    '/Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/google-maps-services-js/dist/directions.js',
    '/Users/tjohns/Src/epic-roadtrip-planner/node_modules/@googlemaps/google-maps-services-js/dist/client.js'
  ]
}

Node.js v21.2.0

From package-lock.json:

    "node_modules/@googlemaps/url-signature": {
      "version": "1.0.35",
      "resolved": "https://registry.npmjs.org/@googlemaps/url-signature/-/url-signature-1.0.35.tgz",
      "integrity": "sha512-UvDUghW8bJTVSGb0G4j2eEIsUWCdVXRZlhxeCT/ZmG44lebW85v716L0ExO/m1or2DKswsZ+Bx6UUwSHDDHsIw==",
      "dependencies": {
        "crypto-js": "^4.2.0"
      }
    },

@rvitaliy
Copy link

@wangela hey please can you ping someone of yours to dump a new version 🙏

@soulchild
Copy link

Please somebody release a new version already. Overrides do not work correctly in monorepos/with npm workspaces. 🙏

@luskin
Copy link

luskin commented Jul 17, 2024

+1

@TimJohns
Copy link

TimJohns commented Aug 2, 2024

FYI - I'm no longer seeing the error in my environment as of the 1.0.36 release.

I now have no overrides or core-js in my package.json. I attempted to repro in Node v21.2.0 (where I most recently confirmed I was still seeing it) and v22.4.1 (npm v10.8.1), my current environment. I'm still tying to track down the specific change that may have resolved this for me, but I'm currently lost in the details of the latest babel environment updates, and I got a little excited, so figured I'd jump over here and add a comment here real quick before digging in further.

Can anyone confirm this is resolved and/or have details of what theoretically resolved it? Fingers crossed (and thanks!)

@zackdotcomputer
Copy link
Contributor

Appears to be working locally for me too now.

Checking out the diff on 1.0.36, it looks like the updates to babel also updated a dependency chain through browserlist that caused a minor version update to the caniuse-lite db, which I'd identified as the underlying problem here. I think that is what fixed this issue.

Happy it's fixed, though a little disappointed that it happened incidentally like this and that no one at Google cared to respond or help for the past 3 months while this has been broken...

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