Skip to content
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

Warning: Critical dependency: the request of a dependency is an expression #6660

Closed
anisabboud opened this issue Oct 7, 2022 · 16 comments · Fixed by #6665
Closed

Warning: Critical dependency: the request of a dependency is an expression #6660

anisabboud opened this issue Oct 7, 2022 · 16 comments · Fixed by #6665

Comments

@anisabboud
Copy link

Hi, I just updated Firebase SDK to the latest version released yesterday (9.11.0 - 2022-10-06), and now getting a console warning when building the project (with Angular ng build / ng serve):

image

./node_modules/@firebase/util/dist/index.esm2017.js:741:19-44 - Warning: Critical dependency: the request of a dependency is an expression

Specifically, the warning comes from this line:
image

which seems to be in this file: firebase-js-sdk/packages/util/src/deferred.ts

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@huzaifa3165
Copy link

I'm also getting the same warning.

@hsubox76
Copy link
Contributor

hsubox76 commented Oct 7, 2022

This is puzzling because that file hasn't been updated in 2 years. Did you upgrade directly from 9.10.0 to 9.11.0 or did you start from a version earlier than 9.10.0? Did you update any other dependencies as part of that update?

This is the first time @firebase/util has had a version bump since July so it's possible some commit to util between then and now caused it also.

Which products are you using (analytics, app-check, database, firestore, etc.)? It might also be that something changed in the way the product code calls Deferred.

@hsubox76
Copy link
Contributor

hsubox76 commented Oct 7, 2022

Actually I looked up the error and it seems it's a webpack warning about using require() on a dynamic variable. In that case it's most likely caused by this line, which was added recently:

const json = require(defaultsJsonPath);

and it looks like the source map is a little bit off so it's pointing at a different location in the util bundle. I'll see what I can do to address this.

@nandorojo
Copy link

Seeing the same thing on Next.js. Thanks for looking into it @hsubox76.

@tomasconnor
Copy link

+1

@Amansg4
Copy link

Amansg4 commented Oct 7, 2022

Just had this problem. +1. Don't know a fix though

@nandorojo
Copy link

Downgrading to 9.10 fixed it for me.

@hsubox76
Copy link
Contributor

hsubox76 commented Oct 7, 2022

The warning shouldn't affect any code functionality but you can downgrade to 9.10.0 if you want to avoid having a warning (or if I'm wrong and it is affecting your code). I have a fix (#6665) which should be released next week.

@dodomui
Copy link

dodomui commented Oct 8, 2022

+1

@meenal21
Copy link

meenal21 commented Oct 8, 2022

+1. downgrading to 9.10.0 fixed the issue!

@BasilArackal
Copy link

I'm also getting the same warning on a Next.js project

@sdk1990
Copy link

sdk1990 commented Oct 10, 2022

+1 on a Next.js project

@abwhb
Copy link

abwhb commented Oct 10, 2022

+1 on a Next.js project as well

@hsubox76
Copy link
Contributor

As mentioned above, the fix has been merged and will be released this week.

@hsubox76
Copy link
Contributor

The fix has been released in 9.12.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.