angularwebpackangular-google-maps

NPM watch error: ReferenceError: _ is not defined at ../node_modules/angular-google-maps/dist/angular-google-maps.js (angular-google-maps.js:1:1)


I'm using Angular and I've restarted mycomputer and in the browser at the console section appeared to me an error:

Unhandled Promise rejection: _ is not defined ; Zone: <root> ; Task: Promise.then ; Value: ReferenceError: _ is not defined at ../node_modules/angular-google-maps/dist/angular-google-maps.js (angular-google-maps.js:1:1)

I reinstalled node-modules, but still nothing, on the github there is an issue: https://github.com/sebholstein/angular-google-maps/issues/1932

But still nothing.


Solution

    1. Delete node-modules folder
    2. Update your npm and node: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm and https://nodejs.org/en/download
    3. Then do npm cache clean --force
    4. Run npm ci
    5. Rerun the watch

    If still doesn't work, then after 2nd step do the following:

    npm uninstall angular-google-maps
    
    npm install @agm/core --legacy-peer-deps