vercel: [now-next] Module not found: Can't resolve 'request' when importing firebase database
I encountered a error below when deploying to now.
ModuleNotFoundError: Module not found: Error: Can’t resolve ‘request’ in ‘/tmp/5db89640/node_modules/@firebase/database/dist’
My dependencies is only
{
"dependencies": {
"antd": "^3.12.3",
"firebase": "^5.7.3",
"next": "^7.0.2",
"react": "^16.7.0",
"react-dom": "^16.7.0"
}
}
and my now.json is
{
"version": 2,
"builds": [
{ "src": "next.config.js", "use": "@now/next" }
]
}
The error occured after install firebase.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (5 by maintainers)
Fixed in https://github.com/zeit/now/pull/2924, currently on canary builder.
@diogoviannaaraujo I had the same issue for a week and just fixed it. Try:
yarnornpm i)Not sure exactly which step fixed it for me, but after doing all of them, my app now deploys via
nowandnow devfor Next 9.I am using firebase in nextapp and unable while deploying to ZEIT it shows error
Error log comes out to be this,
My package.json file looks like this
and next-config.js looks like this
Hope it helps for solving the error.
Use this library GitHub repo https://github.com/dksami/NextBigThing and use whatever library you need and it will work however I am afraid that database firebase might not work / if fix? star the repo Feel Free to Fork @mtrabelsi @samantonis @skoch
same thing for me when using IOTA library, time to find a serious deployment tools, we pay premium for shitty-crappy-weirdo tools
I also tried deploying static version but didn’t get that working either (the website builds and loads fine , but firebase stuff fails )
I’m seeing this issue as well when trying to use firebase with a serverless target in next.config.js.
Thanks for putting that repo together @CarlosBolanos
This may be a duplicate issue.
I’m having the same issue as youkyll.
i created a small github repo (https://github.com/CarlosBolanos/next-redux-firebase)
i was able to deploy to now the part with next and the redux wrapper, but when i require firebase the now cli fail to deploy with the error ‘Can’t resolve ‘request’ in ‘/tmp/73d905f1/node_modules/@firebase/database/dist’’.
hope this helps…