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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve 'xxx' #16640

Closed
HarelM opened this issue Jan 11, 2020 · 9 comments
Closed

Module not found: Error: Can't resolve 'xxx' #16640

HarelM opened this issue Jan 11, 2020 · 9 comments

Comments

@HarelM
Copy link

@HarelM HarelM commented Jan 11, 2020

馃悶 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Maybe, but it wasn't broken recently...

Description

A clear and concise description of the problem...

When importing an interface that is not in use inside a class, production build fails while debug build succeeds.

馃敩 Minimal Reproduction

I'm not entirely sure, I think it's more complicated than a minimal reproduction.
Having said that, the following appvayor build fails with the relevant error message:
https://ci.appveyor.com/project/IsraelHikingHost/site/builds/30035366/job/hexmayblho5divm7
While the following succeeds:
https://ci.appveyor.com/project/IsraelHikingHost/site/builds/30041191/job/kambg0o4pinm408w
The following is the only change (removed unused interface from import statement):
IsraelHikingMap/Site@d18ce48
Repository can be found here:
https://github.com/IsraelHikingMap/Site/
Relevant directory is the IsraelHiking.Web.

馃敟 Exception or Error

I expect the production build to either fail with a meaningful error message or not fail at all.
I have spent several days to understand what was wrong the first time I encountered this issue. Fixing it will reduce other developers' frustrations.

馃實 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / 鈻 \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.0.3
Node: 10.15.3
OS: win32 x64
Angular: 8.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.3
@angular-devkit/build-angular     0.800.3
@angular-devkit/build-optimizer   0.800.3
@angular-devkit/build-webpack     0.800.3
@angular-devkit/core              8.0.3
@angular-devkit/schematics        8.0.3
@angular/cdk                      8.0.1
@angular/cli                      8.0.3
@angular/flex-layout              8.0.0-beta.26
@angular/material                 8.0.1
@ngtools/webpack                  8.0.3
@schematics/angular               8.0.3
@schematics/update                0.800.3
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0


Anything else relevant?

@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Jan 13, 2020

Can you try with the latest version of 8.x (currently 8.3.22)?

@HarelM

This comment has been minimized.

Copy link
Author

@HarelM HarelM commented Jan 13, 2020

I'll try, assuming it will not cost me the entire night to upgrade angular to the latest version...

@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Jan 13, 2020

npm i -D @angular/cli@8.3.22 & npm i -D @angular-devkit/build-angular@0.803.22 should be sufficient to test the issue.

@HarelM

This comment has been minimized.

Copy link
Author

@HarelM HarelM commented Jan 13, 2020

@clydin Thanks for the quick response and guidance!
Seems like the issue was resolved in latest version.
I'll run a clean build using my CI server and if everything is working as expected I'll close this issue.

@HarelM

This comment has been minimized.

Copy link
Author

@HarelM HarelM commented Jan 13, 2020

Well, not surprisingly, After doing the above upgrade my tests started to fail with a different error message:
Cannot read property 'ngMetadataName' of undefined
Probably related to #14888
I remembered there was a reason I didn't upgrade from 8.0.3 although when upgrading 8.0.4 was available...
Build is here:
https://ci.appveyor.com/project/IsraelHikingHost/site/builds/30086131/job/4b5cip9aw124u7kp

@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Jan 14, 2020

Updating Angular to at least 8.1 should fix that error.

@HarelM

This comment has been minimized.

Copy link
Author

@HarelM HarelM commented Jan 14, 2020

I'll try it tonight and update. I can't say that the error messages are developer friendly... :-/

@HarelM

This comment has been minimized.

Copy link
Author

@HarelM HarelM commented Jan 14, 2020

@clydin Thanks for your support. Seems like this doesn't reproduce in latest versions.

@HarelM HarelM closed this Jan 14, 2020
@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Jan 14, 2020

No problem. Good to hear everything is working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.