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 SSR: "Couldn't find any 'pages' or 'app' directory. Please create one under the project root" #7128

Open
nilsreichardt opened this issue May 8, 2024 · 2 comments

Comments

@nilsreichardt
Copy link
Contributor

[REQUIRED] Environment info

firebase-tools: 13.8.0

Platform: macOS

[REQUIRED] Test case

Our docs using Nextra: https://github.com/SharezoneApp/sharezone-app/tree/main/docs

[REQUIRED] Steps to reproduce

  1. Clone our Nextra docs: https://github.com/SharezoneApp/sharezone-app/tree/main/docs
  2. Enable web frameworks
  3. Update firebase.json and .firebaserc to use your own Firebase project
  4. Run firebase deploy

[REQUIRED] Expected behavior

No errors in the console.

[REQUIRED] Actual behavior

We are getting a lot of error in our console for our ssrsharezonedocsprod cloud function:

image


Error: > Couldn't find any `pages` or `app` directory. Please create one under the project root
    at findPagesDir (/workspace/node_modules/next/dist/lib/find-pages-dir.js:42:15)
    at findPagesDirectory (/workspace/node_modules/nextra/dist/index.js:169:15)
    at Object.<anonymous> (/workspace/node_modules/nextra/dist/index.js:173:53)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at mod.require (/workspace/node_modules/next/dist/server/require-hook.js:65:28)
    at require (node:internal/modules/helpers:177:18)

The source folder of deployed cloud function (downloaded via GCP console):

image

Local functions folder in .firebase:

image

@aalej
Copy link
Contributor

aalej commented May 9, 2024

Hey @nilsreichardt, thanks for the detailed report. Sorry to hear you encounter this issue. I’m currently unable to reproduce this. I tried following the steps provided, but no errors were raised during deployment or when visiting the site.

image

I also tried visiting the other pages on the deployed site but no errors were raised as well. Does the error message occur when visiting a specific page?

Could you try deploying using firebase-tools 13.8.1? Also, regarding the screenshot of the function-source you downloaded, could you try running ls -a to see if there are also other files downloaded? I’m guessing there may be some hidden files which are not being shown when using finder.

@aalej aalej added the Needs: Author Feedback Issues awaiting author feedback label May 9, 2024
@nilsreichardt
Copy link
Contributor Author

Sorry, that I wasn't clear about the issue. The deployment is fine. It's running in production at https://docs.sharezone.net. However, our Google Cloud logs are spammed by the SSR cloud function (see screenshot). My goal is to get rid of the error logs in the cloud function.

Here the screenshot with the hidden files:

image image

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants