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

next.js cannot find pages folder after building for Firebase functions #8926

Closed
ghost opened this issue Oct 2, 2019 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Oct 2, 2019

Bug report

Describe the bug

https://github.com/zeit/next.js/tree/canary/examples/with-firebase-hosting-and-typescript

Next.js cannot find pages folder after building and deploy to firebase functions.
Next.js v9.0.6 seems fine. It works well. but since v9.0.7 Next.js is not.

> protobufjs@6.8.8 postinstall C:\test\test-web\your-app\dist\functions\node_modules\protobufjs
> node scripts/postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN with-firebase-hosting-and-typescript@1.0.0 No repository field.
npm WARN with-firebase-hosting-and-typescript@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.0 (node_modules\firebase-tools\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1323 packages from 618 contributors and audited 13608 packages in 25.735s
found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
+  functions: Finished running predeploy script.
Running command: npm run build-public

> with-firebase-hosting-and-typescript@1.0.0 build-public C:\test\test-web\your-app
> cpx "sources/public/**/*.*" "dist/public" -C

+  hosting: Finished running predeploy script.
i  functions: ensuring necessary APIs are enabled...
+  functions: all necessary APIs are enabled
i  functions: preparing dist/functions 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 (C:\test\test-web\your-app\dist\functions\node_modules\next\dist\lib\find-pages-dir.js:3:170)
    at new DevServer (C:\test\test-web\your-app\dist\functions\node_modules\next\dist\server\next-dev-server.js:1:2679)
    at Object.createServer [as default] (C:\test\test-web\your-app\dist\functions\node_modules\next\dist\server\next.js:2:105)
    at Object.<anonymous> (C:\test\test-web\your-app\dist\functions\index.js:16:27)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)

Having trouble? Try firebase deploy --help
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

npx create-next-app --example with-firebase-hosting-and-typescript your-app
-> edit .firebaserc
{ "projects" : { "default" : "YOUR_PROJECT" } }

firebase use default
npm run deploy

Expected behavior

Next.js App should be deployed to Firebase function.

System information

Google Firebase Functions

@ijjk
Copy link
Member

ijjk commented Oct 2, 2019

Hi, this appears to be a duplicate of #8893 and was fixed in #8896 Note: the update is available in v9.0.8-canary.0

@ijjk ijjk closed this as completed Oct 2, 2019
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants