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

Failed AOT compilation #130

Open
marnec opened this issue Jun 22, 2020 · 2 comments
Open

Failed AOT compilation #130

marnec opened this issue Jun 22, 2020 · 2 comments

Comments

@marnec
Copy link

marnec commented Jun 22, 2020

Hi there, using Angular 9.1.7
Whenever I include D3Service among provides, I get this error:

Uncaught Error: Angular JIT compilation failed: '@angular/compiler' not loaded!
  - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.
  - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?
  - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.
@rwlogel
Copy link

rwlogel commented Jun 27, 2020

I solved this by adding adding this to ngcc.config.js (in the same directory as angular.json):

module.exports = {
  packages: {
    // The d3-ng2-service package is really old and ngcc needs
    // help to know how to build it.
    'd3-ng2-service': {
      entryPoints: {
        '.': {
          override: {
            module: './index.js'
          }
        }
      }
    }
  }
};

@martyandreas
Copy link

@rwlogel
thank you, this has solved the problem for me!

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

3 participants