question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in Symbol when compiling with Ivy

See original GitHub issue

🐞 bug report

Affected Package

ngcc?

Is this a regression?

Version 8.0.3 which is current latest produces a different error as discussed with @petebacondarwin in angular/angular/pull/27326#issuecomment-506625841. Upgrading to 8.1.0-rc.0 fixes the ModuleWithProviders issue but now is returning error below.

Description

When running normal production build with aot=true and Ivy disabled the build process completes successfully. Running with Ivy enabled results in the below error.

πŸ”¬ Minimal Reproduction

https://github.com/davidjeliba/angular-uirouterhybrid-ivy-issue

master branch uses 8.1.0-rc.0 β€œlatest” branch uses angular@latest which is currently 8.0.3 - I provided this just in case there is any value in seeing the previous ModuleWithProviders error.

To setup/run:

Clone project run β€œyarn” run β€œyarn build:production” - aot=true, ivy=false - to show successful compilation run β€œyarn build:production:ivy” - aot=true, ivy=true - produces the error

πŸ”₯ Exception or Error

ERROR in Symbol UIRouterModule declared in angular-uirouterhybrid-ivy-issue/node_modules/@uirouter/angular/lib/uiRouterNgModule.d.ts is not exported from @uirouter/angular-hybrid (import into angular-uirouterhybrid-ivy-issue/src/app/child.module.ts)

🌍 Your Environment

Angular Version:

Angular CLI: 8.1.0-rc.0
Node: 10.15.3
OS: darwin x64
Angular: 8.1.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.0-rc.0
@angular-devkit/build-angular     0.801.0-rc.0
@angular-devkit/build-optimizer   0.801.0-rc.0
@angular-devkit/build-webpack     0.801.0-rc.0
@angular-devkit/core              8.1.0-rc.0
@angular-devkit/schematics        8.1.0-rc.0
@ngtools/webpack                  8.1.0-rc.0
@schematics/angular               8.1.0-rc.0
@schematics/update                0.801.0-rc.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.0

Anything else relevant? After running yarn build:production:ivy and inspecting angular-uirouterhybrid-ivy-issue/node_modules/@uirouter/angular-hybrid/lib/angular-hybrid.d.ts the code is as follows from line 96:

export declare class UIRouterUpgradeModule {
    static forRoot(module?: NgHybridStatesModule): ModuleWithProviders<UIRouterUpgradeModule>;
    static forChild(module?: NgHybridStatesModule): ModuleWithProviders<Ι΅ngcc1.UIRouterModule>;
    static ngModuleDef: Ι΅ngcc0.Ι΅Ι΅NgModuleDefWithMeta<UIRouterUpgradeModule, [typeof UIViewNgUpgrade], [typeof Ι΅ngcc1.UIRouterModule, typeof Ι΅ngcc2.UpgradeModule], [typeof UIViewNgUpgrade, typeof Ι΅ngcc1.UIRouterModule]>;
    static ngInjectorDef: Ι΅ngcc0.Ι΅Ι΅InjectorDef<UIRouterUpgradeModule>;
}

I’m not sure if it is relevant that forRoot has ModuleWithProviders<UIRouterUpgradeModule> while forChild has ModuleWithProviders<engcc1.UIRouterModule>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
petebacondarwincommented, Jun 28, 2019

This is a bug in ngtsc.

When we statically interpret the Ι΅ngcc1.UIRouterModule type expression we lose the fact that it is jumping to another file (probably because of the namespaced import). So then ngtsc thinks that UIRouterModule was declared inside @uirouter/angular-hybrid rather than @uirouter/angular. Therefore it thinks that UIRouterModule is an internal non-exported class inside @uirouter/angular-hybrid, which is basically what the error message is telling us.

Working on a fix πŸ˜ƒ

1reaction
petebacondarwincommented, Jul 1, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

angular 13 ng build library fails (ivy partial compilation mode)
I try ng build my-lib and get the below error. βœ– Compiling with Angular sources in Ivy partial compilation mode. Transform failed withΒ ......
Read more >
Facing compile error during ng serve while setup of new ...
My versions are: Angular CLI: 14.2.7. Node: 14.20.1. Package Manager: npm 8.19.2. OS: linux x64. Today I have purchased angular adminΒ ...
Read more >
AOT metadata errors - Angular
The compiler encountered a referenced to a locally defined symbol that either wasn't exported or wasn't initialized. Here's a provider example of the...
Read more >
The Angular Ivy guide for library authors
The Ivy Instruction Set which is the compilation output in directive and component rendering functions will not be finalised before AngularΒ ...
Read more >
Difference Between % and %% Symbols in build.sbt - Baeldung
Difference Between % and %% Symbols in build.sbt ... /administrator/.ivy2/local/com.typesafe.akka/akka-actor/2.6.5/ivys/ivy.xml [error] notΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found