-
Notifications
You must be signed in to change notification settings - Fork 12k
Error: Uncaught (in promise): TypeError: Gy(…).storage is not a function when using ng build --prod #15140
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
Comments
Hi, can you try updating the angular cli and build angular to If the problem persists after updating, can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via |
Can you please provide me with the correct steps to do that? I have already followed the steps below with no change:
|
The below command should be enough.
|
@alan-agius4 thank you for providing the command and sorry for taking so long to get back to you!
When I ran
The first 3 showed immediately, and the last 2 showed up a few seconds later.
So, I ran
And now I am just back to the original error, happening on the same page and only with Does that give you any additional insight or are you still needing a repro? Thanks! |
Hi @formster-biz, it would be best to provide a reproduction so that we can look at the a bit more. Thanks |
Hi @formster-biz, I am thinking that your issue might be the same root cause of #15145 can you check if setting Thanks |
@alan-agius4 unfortunately, I am getting the same main error, although some of the details are a little different. First I ran
Then I ran
Should I try to update some of those other devkit packages before creating a repro? |
It may be totally unrelated (this is all so far over my head ): ) , but I wanted to mention since it seems really weird that this error only occurs when i route to one specific component in my app - literally every other one works. This component has almost all the same imports as the others, but there is one that is used here that isn't used anywhere else in my app. This component imports/utilizes my The error occurs immediately before the component even has a chance to start ngOnInit, and this service is not even called automatically in ngOnInit, it is only called as needed depending on user input - so maybe it's not related...? Anyway, I just thought it may be worth mentioning, since my error obviously says something about a .storage function. |
@alan-agius4 I just commented out everything related to the |
Hi @formster-biz, in that case a reproduction is definitely need to see what's going on. Thanks. |
Hi, @alan-agius4
It works fine when run with |
Good morning, @alan-agius4 |
@formster-biz, the reproduction is great. Unfortunately I didn't have time to take a look at the problem. |
@alan-agius4 can you please let me know when I should expect an update on this? |
I can repro by:
Btw this was a great repro, well done! I tried to updating to There's a similar issue report in angular/angularfire#1978, but no details there. I went to check the docs (https://github.com/angular/angularfire2/blob/master/docs/storage/storage.md) to see if there was some config item missing and saw that I think this was just a matter of a unhelpful error message from |
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
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: Yes, but I am not sure exactly what was updated since I had made several changes. I just started this project from scratch in May, so nothing was very old.Description
I am getting this error
Error: Uncaught (in promise): TypeError: Gy(...).storage is not a function
but ONLY when I build and deploy my Angular project using ng build --prod. When I deploy using ng build or when I run ng serve, I do not get the error and everything works as expected.Additionally, the error only happens when I try to route to one specific component within my app.
Further, I have discovered that when I change the "target" property under "compilerOptions" in my tsconfig.json file from es2018 to es2015 to es5 or back and forth, it changes the error slightly instead of Gy, it may say Xy, or qy.
Based on suggestions found in some slightly similar issues, I have tried the following:
-Updating all my npm packages
-Upgrading my Angular CLI as per this post: https://stackoverflow.com/a/43931987/10415078
-Running ng update (everything seems to be in order)
🔬 Minimal Reproduction
I am not sure what exactly is causing the error, but I only get it when I navigate to this specific component, and only when I've run ng build --prod.
Here are my imports for that component, but nothing really changed within this component from the time it worked to the time it didn't.
My tsconfig.json file:
My
🔥 Exception or Error
🌍 Your Environment
##Anything Else Relevant?
I am using Firebase and running the app on Chrome browser.
Also, I noticed in my angular.json file that I am getting an error for
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
that says File not found, even though that file definitely exists - I am not sure if this error has always been there or not, but everything runs fine if only I build with ng build or run ng serve.The text was updated successfully, but these errors were encountered: