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
exported default function might break AOT #17518
Comments
This issue seems to be a CLI issue. Please file it at http://github.com/angular/angular-cli/issues/new. This repo is for the Angular framework itself. Thanks! |
@hansl how can this be a cli error? this is the full output when running ngc:
I tought the compiler lies in this repo... |
The referenced PR will fix the crash but will but this code will still not be supported. First, we don't support referencing default functions in AOT metadata. We are working on this but his will not be resolved until sometime after 5.0. Second, the function is not a simple function that we require. I have a document that describes the limitations on TypeScript syntax we support in metadata here https://gist.github.com/chuckjaz/65dcc2fd5f4f5463e492ed0cb93bca60. We are also lifting many of these restrictions for 5.0 but the simple (or macro) function limitation will still be there for 5.0. Changing this to
and then importing We must be able to determine the value of the routes at compile time and we cannot support all the features of JavaScript and TypeScript during this evaluation. We are continually improving this and have significant improvements coming. |
well I think no matter if supported or not. having at least a sane error message would help ;) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ...
Current behavior
Below code fails with:
Expected behavior
That code:
should compile fine under AOT. it's actually a simple array. removing the unncessary variable, should work, too.
Minimal reproduction of the problem with instructions
Create a file called
states.ts
somewhere in your source folder (does not need to be imported) and insert the code above.Run
ng build --prod
.What is the motivation / use case for changing the behavior?
Please tell us about your environment
Angular version: 4.2.2
Browser:
For Tooling issues:
Others:
Might be related, but different error message: #11402
Looks like that works:
which however is also default
The text was updated successfully, but these errors were encountered: