Skip to content

Error: Cannot find module 'core-js/modules/es.string.replace.js' #1194

Description

@abdirahmn1

Am encountering the error code MODULE_NOT_FOUND after updating the package to latest/@3.4.0, this didn't exist about 3 weeks ago. It seems to be a problem with core-js missing, temporarilly installing core-js seems to solve the problem.

Environment details

  1. Specify the API: Not API specific problem.
  2. OS type and version: Linux Mint 21.2 x86_64
  3. Library version and other environment information: lib version is @3.4.0

Steps to reproduce

  1. npm install @googlemaps/google-maps-services-js
  2. instanciate a new client
  3. simply run it

Code example

import { Client } from "@googlemaps/google-maps-services-js";
const newGmapsClient = new Client();
export default newGmapsClient;

Stack trace

node:internal/modules/cjs/loader:1077
  const err = new Error(message);
              ^

Error: Cannot find module 'core-js/modules/es.string.replace.js'
Require stack:
- /<work_dir>/node_modules/@googlemaps/url-signature/dist/index.umd.js
- /<work_dir>/node_modules/@googlemaps/google-maps-services-js/dist/serialize.js
- /<work_dir>/node_modules/@googlemaps/google-maps-services-js/dist/directions.js
- /<work_dir>/node_modules/@googlemaps/google-maps-services-js/dist/client.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:121:18)
    at /<work_dir>/node_modules/@googlemaps/url-signature/dist/index.umd.js:1:79
    at Object.<anonymous> (/<work_dir>/node_modules/@googlemaps/url-signature/dist/index.umd.js:1:807)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/<work_dir>/node_modules/@googlemaps/url-signature/dist/index.umd.js',
    '/<work_dir>/node_modules/@googlemaps/google-maps-services-js/dist/serialize.js',
    '/<work_dir>/node_modules/@googlemaps/google-maps-services-js/dist/directions.js',
    '/<work_dir>/node_modules/@googlemaps/google-maps-services-js/dist/client.js'
  ]
}

Node.js v18.17.1

Hopefully this gets fixed soon. 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions