Help needed: Critical dependency: the request of a dependency is an expression

I’m getting WARNING in ../node_modules/faunadb/src/Client.js 73:24-48 Critical dependency: the request of a dependency is an expression @ ../node_modules/faunadb/index.js @ ./all-completed-forms.js


Error during invocation: Error: Cannot find module 'https'

I tried removing NPM packages and lock files, tried fresh installs with either NPM or yarn to see if it helps, but in any case scenario the app crashes, both locally and on Netlify.

I’ve been developing this repo and it worked previously, not sure what happened. I tried running earlier commits but I’m getting the same issue.

I even tried installing https manually.

Any ideas how I can solve?

I’m making some progress, but still need help. I isolated the issue to my local package.lock.json, but it doesn’t work when deployed to Netlify

ok, I’ve managed to solve it. I got my modules reinstalled and did a clean cache build on Netlify to make it work.

1 Like

thanks for sharing your solution, @abtx - this is always super valuable for other users!

Hey can you give a bit more detail here? Been looking at this problem for the better part of the day. Only working in development right now, no prod environment. I’ve cleared out and reinstalled node_modules, tried manually installing https module as well, and seen people recommending downgrading FaunaDB to 2.7.0 but haven’t had any success there. Can you give a bit more detail on how you solved it.


Hi Dan
As far as I remember I redeployed the site using Trigger Deploy > Clear cache and deploy site. Did you try deleting package.lock.json alongside with reinstalling npm modules?

1 Like

thanks for working together to figure this one out!