-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Importing RouterTestingModule in spec files causes AOT/ngc compiler to fail #11276
Comments
getting the same error with 2 projects now with
|
Same error for me.
|
Could someone please add a minimal repro case ? |
@vicb you can reproduce by cloning qdouble's starter and removing if the behavior for you is the same for me and @qdouble, you should get the same error mentioned above -
|
also, @vicb in case it is helpful, this issue happens when the for example, on this line if you replace if (!(type instanceof StaticSymbol)) {
throw new Error(`parameters received ${JSON.stringify(type)} which is not a StaticSymbol`);
} with if (!(type instanceof StaticSymbol) && !type.filePath && !type.name) {
throw new Error(`parameters received ${JSON.stringify(type)} which is not a StaticSymbol`);
} Everything compiles and runs as expected. Obviously that solution is inelegant but was helpful to see that something is either cloning or creating static symbols not using the same StaticSymbol constructor but are perfectly compatible StaticSymbol objects I tried poking around for the source of when this happens, and unfortunately didn't find anything obvious, but I hope this info can still be helpful! |
/cc @chuckjaz |
@qdouble Is this also happening when you manually create a |
@qdouble Ok, I found out why it works for me (though I don't really understand what's going on there). When I add the
When removing the files-property the AOT-Build crashes. |
@choeller I basically got around the issue here by making my AOT tsconfig ignore spec files "exclude": [
"node_modules",
"src/compiled",
"src/**/*.e2e.ts",
"src/**/*.spec.ts",
"src/main.browser.aot.ts"
], |
@choeller: when |
In case it's helpful here, looks to be same issue as #12097 |
After poking around more, I believe the error is pretty simple in In
I'll open a PR for this change shortly |
PR to resolve this sent #12158 |
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 ... (check one with "x")
Current behavior
If I have RouterTestingModule imported in any of my spec files, I will get the following error:
Expected/desired behavior
First of all, there should be an option to make the ngc compiler ignore spec files (other than having to go back and forward in changing your tsconfig setting to ignore spec files). I'll also assume that if it's evaluating spec files, it would make the compilation slower.
Beyond fixing the RouterTestingModule bug, I think ngc should be a setting to make ngc/aot ignore spec/e2e files.
The text was updated successfully, but these errors were encountered: