Skip to content

fix(@schematics/angular): add module option in library tsconfig#11257

Merged
clydin merged 1 commit intoangular:masterfrom
alan-agius4:feature/lib-tsconfig
Jun 17, 2018
Merged

fix(@schematics/angular): add module option in library tsconfig#11257
clydin merged 1 commit intoangular:masterfrom
alan-agius4:feature/lib-tsconfig

Conversation

@alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Jun 15, 2018

When not specified the commonjs will be used which will cause erros when consuming the library Module not found: Error: Can't resolve ' commonjs-proxy:../file

ng-packagr/ng-packagr#944 (comment)

Closes: #11255

//cc @filipesilva

When not specified the `commonjs` will be used which will cause erros when consuming the library `Module not found: Error: Can't resolve ' commonjs-proxy:../file`

ng-packagr/ng-packagr#944

Closes #11255
@devoto13
Copy link
Contributor

devoto13 commented Jun 15, 2018

tsconfig.lib.json extends tsconfig.json, where module is set to es2015.

I think this is a regression from #11196. It moved the module property from multiple places to only tsconfig.json. It should work perfectly fine in the newly generated CLI workspaces. The problem is that existing workspaces don't have module: "es2015" in the root tsconfig.json and therefore generating new lib project in the existing workspace leads to the above error.

PS I suspect that generating new application in the existing workspace will have similar problem.

@alan-agius4
Copy link
Collaborator Author

Yes indeed it's a regression from that PR, not sure how to proceed.

@alan-agius4
Copy link
Collaborator Author

Shall we add this in the migration similar to this?
#11261

@clydin clydin merged commit 76f46bc into angular:master Jun 17, 2018
@alan-agius4 alan-agius4 deleted the feature/lib-tsconfig branch June 17, 2018 14:37
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module not found: Error: Can't resolve 'commonjs-proxy:.

4 participants