You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng serve / ng test - import resolving difference ? #3533
Using a local fix that I have to report errors more efficiently, this is what I see:
# ng serve --aot
** NG Live Development Server is running on http://localhost:4200. **
Hash: 1951a494f4f6edf25474
Time: 5870ms
chunk {0} main.bundle.js, main.bundle.map (main) 59.9 kB {2} [initial] [rendered]
chunk {1} styles.bundle.css, styles.bundle.map, styles.bundle.map (styles) 69 bytes {3} [initial] [rendered]
chunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 1.22 MB [initial] [rendered]
chunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in Cannot determine the module for class PageNotFoundComponent in /Users/hansl/Sources/_Temp/test1/src/app/common/page-not-found/page-not-found.component.ts!
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './app/app.module.ngfactory' in '/Users/hansl/Sources/_Temp/test1/src'
@ ./src/main.ts 4:0-64
@ multi main
ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
Module not found: TypeError: Cannot convert undefined or null to object
@ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 69:15-36 85:15-102
@ ./~/@angular/core/src/linker.js
@ ./~/@angular/core/src/core.js
@ ./~/@angular/core/index.js
@ ./src/main.ts
@ multi main
webpack: bundle is now VALID.
The error is "Cannot determine the module for class PageNotFoundComponent". Every components built need to be declared in an NgModule, so this is an error.
Two things you can do to fix:
add the component to a module's declaration (which seems like what you'd like to do)
change the tsconfig to only compile the main.ts (adding "files": ["main"]).
Point 2 we can actually improve on by having main.ts in our tsconfig by default when creating new apps, so we'll do that. In the meantime you have fixes for this problem and I'll close this issue as fixed.
Activity
Juansasa commentedon Dec 14, 2016
I'm having the same problem, hopes it will be addressed soon
Igonato commentedon Dec 14, 2016
Same Issue. Brakes
app/*imports in testshansl commentedon Dec 15, 2016
Do you have a
baseUrlkey in yourtsconfig.json?vfedoriv commentedon Dec 15, 2016
tsconfig as default generated, "baseUrl": ""
hansl commentedon Dec 15, 2016
Could you provide a project that we can test against? I haven't seen that in beta 22-1 and/or Windows.
Igonato commentedon Dec 16, 2016
@hansl I was on beta 22 updated to beta 22-1 and it went away
vfedoriv commentedon Dec 16, 2016
Here test project
https://github.com/vfedoriv/test1.git
hansl commentedon Dec 16, 2016
Thanks. We'll investigate and come back.
hansl commentedon Dec 16, 2016
I found the problem with your
Using a local fix that I have to report errors more efficiently, this is what I see:
The error is "Cannot determine the module for class PageNotFoundComponent". Every components built need to be declared in an
NgModule, so this is an error.Two things you can do to fix:
main.ts(adding"files": ["main"]).Point 2 we can actually improve on by having
main.tsin our tsconfig by default when creating new apps, so we'll do that. In the meantime you have fixes for this problem and I'll close this issue as fixed.Cheers!
vfedoriv commentedon Dec 17, 2016
Well, i generate clean project w/o other logic and just add one import.
Same error with 'ng test'
Try this: https://github.com/vfedoriv/test3.git
angular-automatic-lock-bot commentedon Sep 6, 2019
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.