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

Comments #1

Closed
samherrmann opened this issue Aug 30, 2018 · 5 comments
Closed

Comments #1

samherrmann opened this issue Aug 30, 2018 · 5 comments

Comments

@samherrmann
Copy link

I do not have access to a development environment right now to run your reproduction, but your setup looks like you're going through what I just went through this past week. Are you by any chance experiencing this error? If yes, upgrade to Typescript 2.9.1.

@kiranjholla
Copy link
Owner

@samherrmann I don't believe the issue I am seeing is the same.

@samherrmann
Copy link
Author

@kiranjholla ok I just cloned your project and played around with it. I got it to build by adding the following line to the public_api.ts file:

export * from './lib/modules/test/test.module';

In other words, the nesting of exports through index.ts files is causing the issue.

@kiranjholla
Copy link
Owner

This has been a very interesting exercise.

@samherrmann I took your advice and added the additional export statement. However, I was not so lucky and found that the build still failed with errors.

Unexpected value 'undefined' exported by the module

ERROR in : Unexpected value 'undefined' exported by the module 'TestModule in path/to/working-dir/dist/my-lib/my-lib.d.ts'

This took me quite a while to figure out, as I had other modules which seemingly were structured the same and did not have this error. I was finally able to isolate the issue to the import statements in the test.module.ts file.

Fixed this error by changing the imports from directory-level to file-level (see branch fix/fix-unexpected-value-error in the repo). Again, the index.ts files were causing the issue.

Can't resolve all parameters for ɵb

Next, I got the following error.

ERROR in : Can't resolve all parameters for ɵb in path/to/working-dir/dist/my-lib/my-lib.d.ts: (?).

By this time I knew to look for more index.ts based imports. Fixed the issue by changing the imports in the test.component.ts file to use file-level imports, eschewing the index.ts files (see branch fix/fix-can't-resolve-all-parameters-error in the repo).

While it was good to get this working finally, I still don't understand why index.ts files are causing such issues with AOT. What is happening within the AOT system that causes otherwise valid Typescript to go so horribly awry?

@samherrmann
Copy link
Author

There are discussions on this topic here.

@kiranjholla
Copy link
Owner

kiranjholla commented Aug 30, 2018

@samherrmann Thanks! Will follow that conversation. 👍

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