Skip to content

Turning off AOT in angular.json for production does not work at runtime #11236

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

Closed
jsgoupil opened this issue Jun 13, 2018 · 3 comments
Closed

Comments

@jsgoupil
Copy link

I'm submitting a...

[X] Bug report

Current behavior

main.331a9edcffa8ca2717f0.js:1 Uncaught Error: Unexpected value 'e' imported by the module 'function(){}'. Please add a @NgModule annotation.
    at ka (main.331a9edcffa8ca2717f0.js:1)
    at main.331a9edcffa8ca2717f0.js:1
    at Array.forEach (<anonymous>)
    at e.getNgModuleMetadata (main.331a9edcffa8ca2717f0.js:1)
    at e._loadModules (main.331a9edcffa8ca2717f0.js:1)
    at e._compileModuleAndComponents (main.331a9edcffa8ca2717f0.js:1)
    at e.compileModuleAsync (main.331a9edcffa8ca2717f0.js:1)
    at e.compileModuleAsync (main.331a9edcffa8ca2717f0.js:1)
    at e.bootstrapModule (main.331a9edcffa8ca2717f0.js:1)
    at Object.zUnb (main.331a9edcffa8ca2717f0.js:1)

Expected behavior

It should work.

Minimal reproduction of the problem with instructions

ng new MyProject
cd MyProject
EDIT line "aot": true, replace by "aot": false
ng serve --configuration production

Navigate to http://localhost:4200/

What is the motivation / use case for changing the behavior?

Environment


Angular version: 6.0.3
Windows 10.
@jsgoupil
Copy link
Author

angular/angular#24450

@filipesilva
Copy link
Contributor

I think this is related to a bug where we didn't error out if AOT was off and Build Optimizer was on. We should error because Build Optimizer only works with AOT.

This is fixed in #11657, but if you still see this behavior let me know so I can reopen.

@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.
Projects
None yet
Development

No branches or pull requests

3 participants