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

exports not found in library for angular-cli AOT #126

Closed
brentchow opened this issue Jun 14, 2017 · 7 comments
Closed

exports not found in library for angular-cli AOT #126

brentchow opened this issue Jun 14, 2017 · 7 comments

Comments

@brentchow
Copy link

Hi there! Looking for some help.

When combining a library with @angular/cli@1.0.0 and AOT, I get an error saying that exports from my Library are not being found.

I run the command:

ng serve -aot

And get a response to:

** NG Live Development Server is running on http://localhost:4200 **
Hash: 1d6060529867a24e1764
Time: 33825ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 233 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 833 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 11.7 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.86 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in ./src/$$_gendir/app/app.module.ngfactory.ts
84:22-28 "export 'ɵb' (imported as 'i23') was not found in '@svrf/web'

[... additional similar WARNINGs...]

webpack: Compiled with warnings.

PS great generator! Thanks a ton for this!

@tonivj5
Copy link

tonivj5 commented Jun 15, 2017

You MUST export all of you export in your ngModule.

To give us a better view of your problem, please provide a demo or repo url 👍

@jvandemo
Copy link
Owner

@brentchow — Is it possible to share your code?

@xxxTonixxx — Thank you for your help, much appreciated! 👍

@saryva
Copy link

saryva commented Jun 22, 2017

Hi,
I have the same problem, if I export all, the build it's ok, but I in my module I don't want export my services. It is possible?

@tomwanzek
Copy link

tomwanzek commented Jun 22, 2017

I am experiencing a similar problem, with a somewhat arbitrary feel to it:

In my library several interfaces/types are defined in separate files in a \shared folder. They are all re-exported through a barrel index.ts for consumption in various components across the Angular modules in the library. Re-exports in the barrel use `export * from './xyz.interface`` notation.

Only one of the interfaces (margin.interface.ts):

/**
 * Interface to describe a conventional margin e.g. to place
 * axes around a rendered object.
 */
export interface Margin {
  top: number;
  right: number;
  bottom: number;
  left: number;
}

is causing the warning stated above in an angular-cli-based application, which uses the library through npm link during development.

All other interfaces/types do not throw the warning, although I do not see any structural difference in how they are included/re-exported.

@jvandemo
Copy link
Owner

@brentchow — Can you please try @sebastianteres' suggestions at #127 (comment) to see if they fix your errors? Thanks!

@brentchow
Copy link
Author

Hi, sorry this took a while to get back to.

Exporting ALL services worked as @xxxTonixxx said and as mentioned in the comment @jvandemo referenced (#127 (comment)).

I'll close this issue. Thanks all!

@jvandemo
Copy link
Owner

@brentchow — Thank you for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants