-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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 Ivy: TypeError: record.factory is not a function #35282
Comments
@davidhel would you be able to share a reproduce scenario for this error (GitHub repository or otherwise)? It is very hard to understand what is going on with just error message and no reproduce scenario. |
I wish I could, but since I don't know what is triggering this issue I am not able at the moment. But I will definitively investigate more and come back if I can. |
@davidhel You might try deleting components until you can narrow it down to a particular part of your app. Then I'd remove some providers / injected items until you can get a minimal repro. |
I found the problem. For some reason I had MaterialModule in providers in AppModule. Looks like it has been there for years but started malfunctioning now after enabling Ivy I close this, but suggests a more friendly error message on this issue. |
Same here! I've got an own module in providers array. Awesome! |
I had the same problem, but the solution was quite different. When I triggered the |
I have encountered the same problem, because |
Came here to say I ran into the same problem upgrading my app from 8 to 9. I discovered the issue is a rather roundabout way, but essentially one of my modules had @Injectable in it as well. I found which one by logging the value of the token within the below function. This function is located in this file:
|
same here, fixed removing the "@Injectable()" from modules. VM2917 vendor.js:25841 ERROR Error: Uncaught (in promise): TypeError: record.factory is not a function |
Had the same issue. Codelens reveals the issue to be created when i ran ng-update to upgrade from ng8 to ng9, as shown in the screenshot. Probably easiest way to find if it affects you is to search your project for '@NgModule' since there are usually fewer modules to hunt through, but alternately you will have to search for all '@Injectable()' references to find the extraneous one. |
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. |
🐞 bug report
Affected Package
core.js
Is this a regression?
Yes, it works when I set "enableIvy": false,
But does not work with: "enableIvy": true,
Description
This is a runtime error, there is no build error.
I post this to get help me to get in the right direction to fixing this, and also if anyone else have the same issue after turning on Ivy. At the moment I am clueless.
I have tried many things, to mention a few:
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
🔬 Minimal Reproduction
Sorry I don't know how to reproduce this outside my own solution. It is a large enterprise solution.
🔥 Exception or Error
Fails in main.ts
platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.error(err));
🌍 Your Environment
Angular Version:
The text was updated successfully, but these errors were encountered: