Error in deploy
See original GitHub issueThis example with erro in deploy
yarn build ✔ yarn serve ✔
i deploying functions, hosting i functions: ensuring necessary APIs are enabled… ✔ functions: all necessary APIs are enabled i functions: preparing . directory for uploading…
Error: Error occurred while parsing your function triggers.
Error: > Couldn’t find a pages
directory. Please create one under the project root
at findPagesDir (/Users/robsonkades/Documents/myprojects/firebase-gcp-examples/functions-nextjs/node_modules/next/dist/lib/find-pages-dir.js:3:170)
at new DevServer (/Users/robsonkades/Documents/myprojects/firebase-gcp-examples/functions-nextjs/node_modules/next/dist/server/next-dev-server.js:1:2962)
at createServer (/Users/robsonkades/Documents/myprojects/firebase-gcp-examples/functions-nextjs/node_modules/next/dist/server/next.js:2:105)
at Object.<anonymous> (/Users/robsonkades/Documents/myprojects/firebase-gcp-examples/functions-nextjs/dist/server/index.js:22:31)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
Issue Analytics
- State:
- Created 4 years ago
- Comments:30 (13 by maintainers)
Hi all, please see my new example which addressed many of the issues people had with the setup. I believe the structure will cause less confusion.
https://github.com/jthegedus/firebase-gcp-examples/tree/master/functions-nextjs
Lol, sorry about that.
I have the new emulator in this example, though the Next.js development server doesn’t run well on the local Cloud Function. I don’t think you will need to run the local emulator though as the
next dev
server does most of what you need. The Cloud Function server is just a bridge between the two envs, not a fully working development setup.Given the drastically new example I will close this. If you find issues with the new setup please do raise new issues! Thanks
@robsonkades I changed
"deploy": "yarn firebase deploy --only functions,hosting"
to
"deploy": "NODE_ENV=production yarn firebase deploy --only functions,hosting"
and it worked