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
Getting: Error: Cannot find module '@firebase/component' on 8.6.0 #714
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
worked after adding @firebase/component as dependency |
facing the same issue |
We also started getting this issue 2-3 hours ago. And we use latest 8.8.0 version. So seems this problem thrown by some dependency. |
Was going to file this issue last night but was busy fighting errors in production servers caused by this. The main Think the quick fix for this would be if you guys just release a new version with all |
Fix underway at firebase/firebase-js-sdk#2416 |
For those who are looking for an immediate workaround: https://twitter.com/plane1113/status/1203009025232654336 |
The fix of manually installing
|
@parkerself22 Do you have |
@Feiyang1 no we do not, the only firebase dependency we have in package.json is |
Can you share your package.json? If you are able to inspect your |
@Feiyang1 my apologies, looks like we actually do. I was not aware of the $ yarn why @firebase/app
yarn why v1.19.1
[1/4] 🤔 Why do we have the module "@firebase/app"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "@firebase/app@0.4.17"
info Reasons this module exists
- "geofirestore#firebase" depends on it
- Hoisted from "geofirestore#firebase#@firebase#app"
info Disk size without dependencies: "448KB"
info Disk size with unique dependencies: "1.32MB"
info Disk size with transitive dependencies: "1.32MB"
info Number of shared dependencies: 6
✨ Done in 1.70s. |
Though now it looks like the release went through, so I'll try that first. Thanks for quickly resolving this 👍 @Feiyang1 @hiranya911 In terms of preventing this in the future, would you guys consider pinning the |
I don't think we want to pin the dependency versions. We want developers to be able to get the latest dependency versions whenever possible. I'd rather have some tests in the JS SDK to detect this sort of issues before releases. Also I don't think pinning dependency versions is a reliable solution -- since we can only pin our immediate dependencies, where each of them can have transitive dependencies declared with wildcards. |
You could pin the From the perspective of just this library, you clearly have a volatile dependency with a broken release process in The other option would be to just integrate this package into the monorepo, I'll admit I haven't looked at the internals of this package much so I don't know if that is feasible. Is that an option? If all of firebase was a single package we wouldn't have been affected by this issue either. Sorry for the rant, little worn out from dealing with this all afternoon. Our CI tests actually caught the issue, but we then hurried through the "install |
@parkerself22 I'm not suggesting we don't do anything to prevent this sort of issues. It's just that I'm not convinced freezing the dependency versions is the right solution. At its face this solution sounds like we are declaring that the new JS SDK release artifacts are unreliable, and so let's work around it in the downstream projects by taking dependencies on older versions. I'd rather work with the JS SDK team to see if they can provide stronger and enforceable contracts for their release artifacts. The other downside of pinning the versions is that it is only effective if we release |
@hiranya911 I agree with the first point on working closer with the JS team being the easiest solution (For the sake of the argument I mostly wrote my suggestions from a naive perspective where the two packages weren't as connected as they are). And the release process being manual explains why my Renovate fix wouldn't work to keep deps up to date automatically. Thanks for taking the time to reply to all my concerns, I hope I didn't come off as giving you too hard of a time, I do sincerely appreciate everything ya'll do and think all the Firebase js libraries are really well done. |
@Feiyang1 node_modules/@firebase/app does not exist for me... |
@samoule007 What error do you have? |
TypeError: instance.INTERNAL.registerComponent is not a function |
That's weird. Can you delete the node_modules and the lock file, then reinstall and see if the error goes away for you? The line that gives you error only executes if |
Thank you, I just solved the probleme ! @firebase/app was absent so I did : $ install firebase |
I found out why I was experiencing this dumbfounding error. Clean install today (no node_modules and no package-lock.json) of new firebase-admin 8.9.0 results in error:
The code causing this is in this function:
Although
What I found out: my project folder that included the
My project directory structure exists forever so I don't understand completely what change started producing this error - I assume its a recent code change in the firebase/database module - but separating the project to a truly clean dependency environment cleared this up. |
@shaibt thanks for this find! But this basically means that in a yarn workspace setting, this is not possible? Unless doing special handling with no hoisting or something? |
Thanks shaibt. If I rename the node_modules in the parent folder I get no errors. If not, I get:
|
I'm not sure of your exact setup, but you shouldn't have to do anything special as long as the version of The most likely cause of this kind of error, where you have
is that the parent dir is depending on an older version of A reinstall won't work if you have locked your version of |
Thank you, updating firebase in the parent dir solved it. |
@hsubox76 Hi Christina - Lots of googling got me here. I'm getting the error documented here when running
This is what my package.json looks like
So I'm using 7.5.2, but am still getting this error. I notice that if I upgrade @firebase/app to the latest version, my app breaks due to using another library (https://github.com/tylermcginnis/re-base/). Will be really difficult to debug why that library is breaking, so hoping to find a solution around this Any advice? |
If you're still having problems, open an issue in https://github.com/firebase/firebase-js-sdk if you are definitely using |
@hsubox76 wtf. why updating firebase-js-sdk affects firebase-admin?? I've faced the same problem with latest and got this error. after updating firebase-js-sdk in parent folder it started working. why does firebase-admin/functions even check anything in parent folder's node_modules??? |
In my case, I already had @firebase/app as part of firebase. I also have node 12 installed with Win 10
I fixed the issue by updating the firebase dependencies to the latest.
From my package.json:
Note: Always update firebase-tool to the latest:
|
After moving to 8.8.0 and reverting back to 8.6.0 started getting the following error:
Error: Cannot find module '@firebase/component'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
at Function.Module._load (internal/modules/cjs/loader.js:497:25)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/opt/deployment/production/longwalks_666/node_modules/@firebase/database/dist/index.node.cjs.js:9:17)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
NPM verstion: 6.4.1
Node Version: 10.14.2
Have tried npm uninstall and reinstall removing the lock file.
The text was updated successfully, but these errors were encountered: