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

Can't resolve 'google-maps/lib/types/index' #86

Open
niklaas opened this issue Jul 14, 2020 · 1 comment
Open

Can't resolve 'google-maps/lib/types/index' #86

niklaas opened this issue Jul 14, 2020 · 1 comment

Comments

@niklaas
Copy link

niklaas commented Jul 14, 2020

I get the following error when building an Angular project that uses an Angular library that uses google-maps-loader:

ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'google-maps/lib/types/index' in '/Users/ngersdorff/git/ng-library-testproject/src/app'

I could fix this by adding the lines maked with X to tsconfig.app.json of the Angular project that uses the Angular library in question:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "paths": { X
      "google-maps/lib/types/index": [ X
        "src/empty.js" X
      ]
    }
  },
  "files": ["src/main.ts", "src/polyfills.ts"],
  "include": ["src/**/*.d.ts"],
  "exclude": ["src/test.ts", "src/**/*.spec.ts"]
}

src/empty.js is completely empty.

I would like to provide a minimal example project that let others reproduce the problem but that would take some time. Before doing so: Do you already have an idea what this issue might be about?

// package.json
{
    ...
    "google-maps": "^4.2.3"
    ...
}
@davidkudera
Copy link
Owner

Hello, do you have some special webpack configuration in your angular project? I'm using this package in angular (versions 8 and 10) without any problems.

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