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

Angular compiler plugin not reporting some cases of not finding an entry module #12238

Closed
mascarenhas opened this issue Sep 11, 2018 · 5 comments · Fixed by #12559
Closed

Angular compiler plugin not reporting some cases of not finding an entry module #12238

mascarenhas opened this issue Sep 11, 2018 · 5 comments · Fixed by #12559
Labels
area: ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely needs: more info Reporter must clarify the issue severity3: broken type: bug/fix
Milestone

Comments

@mascarenhas
Copy link

The three lines starting at

if (bootstrap.length != 1) {

are bailing out without throwing the error at the end of resolveEntryModuleFromMain, which causes the build to proceed silently but generate bundles that actually fail at runtime. This should probably throw the same error.

@alan-agius4
Copy link
Collaborator

Can you setup a minimal repro please when this should error out?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Sep 14, 2018
@mascarenhas
Copy link
Author

Done, please check this repo. If you go main.ts and swap the custom bootstrap code for the standard one the lazily loaded route works and shows repro works! in the home page. With the custom bootstrap code the lazily-loaded chunk does not get compiled, the message does not show up, and the following error appears in the console:

ERROR Error: Uncaught (in promise): Error: Cannot find module './repro/repro.module'
Error: Cannot find module './repro/repro.module'
    at $_lazy_route_resource lazy namespace object:5
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:3824)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
    at zone.js:872
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:3815)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at $_lazy_route_resource lazy namespace object:5
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:3824)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
    at zone.js:872
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:3815)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at resolvePromise (zone.js:814)
    at resolvePromise (zone.js:771)
    at zone.js:873
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:3815)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at drainMicroTaskQueue (zone.js:595)

@alan-agius4 alan-agius4 added area: ngtools/webpack and removed needs: more info Reporter must clarify the issue labels Sep 14, 2018
@ngbot ngbot bot added this to the needsTriage milestone Sep 14, 2018
@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Oct 11, 2018
@alan-agius4
Copy link
Collaborator

Hi, I had a look at your reproduction however in your main.ts I can only find the standard bootstrap code.

https://github.com/mascarenhas/angular-cli-issue-12238-repro/blob/d86782acff4eef3cf730517194c6b7c057f9710b/src/main.ts#L1-L12

@alan-agius4 alan-agius4 removed the needs: more info Reporter must clarify the issue label Oct 11, 2018
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels Oct 11, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Oct 11, 2018
@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Oct 11, 2018
@mascarenhas
Copy link
Author

Sorry, I had forgot to push the changes, they are in the repository now.

kyliau pushed a commit that referenced this issue Oct 23, 2018
…disabled

At the moment this will cause a runtime error instead. With this change a warning will be shown during the build.

Closes #12238 and Closes #12025
kyliau pushed a commit that referenced this issue Oct 23, 2018
…disabled

At the moment this will cause a runtime error instead. With this change a warning will be shown during the build.

Closes #12238 and Closes #12025
@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
ikjelle pushed a commit to ikjelle/angular-cli that referenced this issue Mar 26, 2024
…disabled

At the moment this will cause a runtime error instead. With this change a warning will be shown during the build.

Closes angular#12238 and Closes angular#12025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely needs: more info Reporter must clarify the issue severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants