Giter Club home page Giter Club logo

Comments (8)

gregdingle avatar gregdingle commented on August 30, 2024 2

from firebase-gcp-examples.

jthegedus avatar jthegedus commented on August 30, 2024 1

Yeah definitely, I was going to look into the details eventually ๐Ÿ˜…

Added to caveats in 061668b

If you continue to investigate and get this working, please share here!

from firebase-gcp-examples.

gregdingle avatar gregdingle commented on August 30, 2024 1

from firebase-gcp-examples.

jthegedus avatar jthegedus commented on August 30, 2024

Yeah, I could never get preview mode to work when I wrote that example. I haven't delved into why that is the case. When you say you can get it to work locally, is that using the Firebase Emulator, or just Next.js by itself?

from firebase-gcp-examples.

gregdingle avatar gregdingle commented on August 30, 2024

Thanks for the quick response. I was just using Next by itself.

Maybe "no preview mode" is something to add to the caveats on https://github.com/jthegedus/firebase-gcp-examples/tree/master/functions-nextjs#caveats .

from firebase-gcp-examples.

gregdingle avatar gregdingle commented on August 30, 2024

I continued investigating and I isolated the cause to the custom distDir which we copied from the repo here. I don't know why that would be. Firebase does not seem to accept the default .next dir so I'm still at a loss. I only know it works when deployed without a distDir to vercel.

from firebase-gcp-examples.

jthegedus avatar jthegedus commented on August 30, 2024

I think the test cases would have to be all on Firebase. It does not surprise me it works on Vercel without any special config as their platform knows how Next.js apps are built by default.

With Firebase we're doing quite a lot of things. The distDir config is so the Next.js server that runs on the Cloud Function can find the client-side code to the run SSR. The client-side code is in distDir which we deploy with the server code in the Cloud Function. Firebase by default ignores . prefixed dirs, so .next (the default distDir) is ignored on deployment to Cloud Functions and so the Next.js SSR server on Cloud Functions cannot find the client-side code as it doesn't get uploaded. So we need a custom distDir. It would be odd to me that preview mode would require the default distDir so I think it's something else to do with Firebase.

from firebase-gcp-examples.

jthegedus avatar jthegedus commented on August 30, 2024

Oh, so you found an issue with preview mode when deployed to Vercel with a custom distDir?

from firebase-gcp-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.