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

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

Closed
AlexanderKozhevin opened this issue Jun 15, 2018 · 3 comments · Fixed by #11257, angular-indonesia/angular-cli#203 or TypescriptID/angular-cli#155

Comments

@AlexanderKozhevin
Copy link

AlexanderKozhevin commented Jun 15, 2018

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [ ] devkit
- [ ] schematics

node v8.11.1
npm 6.1.0

macOS Sierra

Repro steps

I just followed example from official wiki to create new library. But when I tried to use new module or component, I got an error in the console.
I created project from scratch with angular-cli (Angular CLI: 6.1.0-rc.0).
Angular (6.1.0-beta.1)

ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjs-proxy:./lib/tvmaze.component' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjs-proxy:./lib/tvmaze.module' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjs-proxy:./lib/tvmaze.service' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjs-proxy:./public_api' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjs-proxy:./tvmaze.component' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjs-proxy:@angular/core' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
ERROR in ./dist/tvmaze/fesm5/tvmaze.js
Module not found: Error: Can't resolve 'commonjsHelpers' in '/Users/alexanderkozhevin/Desktop/lib-demo/dist/tvmaze/fesm5'
@AlexanderKozhevin
Copy link
Author

https://github.com/AlexanderKozhevin/angular6-library-test
Here is the demo.
Created project from scratch, added library, got an error.
Please, let me know if you know how to fix that.

@AlexanderKozhevin
Copy link
Author

Ok, apparently problem has been solved.
ng-packagr/ng-packagr#944

clydin pushed a commit that referenced this issue Jun 17, 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

Closes #11255
clydin pushed a commit that referenced this issue Jul 2, 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

Closes #11255
@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant