- Notifications
You must be signed in to change notification settings - Fork991
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Edit: Consider reading this comment first:#4980 (reply in thread) Hi, I just have to share another solution for using NextJS with firebase, that I haven't found on the web yet. I have been using Dynamic routing can be made possible easily however, by using firebase hosting rewrites. And instead of writing them on your own, you can easily copy pase them from your build nextjs page. Just go to and paste it to done! Hope it will help some people. Edit 03.05.2022: |
BetaWas this translation helpful?Give feedback.
All reactions
👍 11👎 1❤️ 22🚀 7
Replies: 11 comments 15 replies
-
Thank you! <3 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you ! I was searching for a solution since hours 🙏 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Can you show me exactly how you do it? I tried changing the file firebase.json, but it's not working!!! |
BetaWas this translation helpful?Give feedback.
All reactions
-
@silverit did you find any solution? Because i have the same issue as you with exact the same firebase.json |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
In my case, I added this line |
BetaWas this translation helpful?Give feedback.
All reactions
🎉 2
-
Do you use SSR ? If you do , then you should use Vercel instead of Firebase . SSR doesn’t work on Firebase |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
@samuelrondot for SSR to work with firebase you also need to add a rewrite rule such as: Replace PROJECTNAME with your firebase project name. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thanks for your help. I found a way to fix my issue. I just add thisline `trailingSlash: true` to file `next.config.js`. Let NextJS generate the index.html file foreach slug. …On Tue, May 3, 2022 at 8:42 PM aki matsumoto ***@***.***> wrote: I made the following changes and it works. {- "destination": "/post/[slug].html",+ "destination": "/post/[slug]/index.html", "regex": "^/post/([^/]+?)(?:/)?$" } — Reply to this email directly, view it on GitHub <#4980 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AARY36G6ENVJQS2OMCHVI6TVIEULVANCNFSM46CP4O7Q> . You are receiving this because you were mentioned.Message ID: ***@***.*** com> -- Thanks & B. Regards,Phuong VoMobile App Developerm:0976071270e:***@***.*** |
BetaWas this translation helpful?Give feedback.
All reactions
-
I have the same issue but this solution didn't work for me |
BetaWas this translation helpful?Give feedback.
All reactions
-
OMG. That was it. |
BetaWas this translation helpful?Give feedback.
All reactions
🎉 1
-
@ibussieres can you show me how you did it? im having the same issue in next 13 |
BetaWas this translation helpful?Give feedback.
All reactions
-
@dominicdev try the gist / script above. If you let it fully generate your file, then it should work. That's what@ibussieres did. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
"I wrote a script [...]" @haris-aqeel I am confused. Your gist is identical to mine: I am glad my script was helpful to you, but please don't take credit for someone else's work. Did you mean to improve it in some way? If so, great. Please share that. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@jeff-r-koyaltech I actually improved it to pass the path dynamically through cmd as args instead of writing it in the file, but I realized it was not a significant contribution, so removed it. No issues. |
BetaWas this translation helpful?Give feedback.
All reactions
-
You're a legend! |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
-
BetaWas this translation helpful?Give feedback.
All reactions
-
"I wrote a script [...]" I am confused. Your gist is identical to mine: I am glad my script was helpful to you, but please don't take credit for someone else's work. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I managed to solve this by doing the following:
Here's the code.... all made by chat-gpt of course 😅 package.jsonupdateFirebaseRewrites.js |
BetaWas this translation helpful?Give feedback.
All reactions
👍 4
-
Perfect, thank you 🙌 |
BetaWas this translation helpful?Give feedback.
All reactions
-
thank you so much i just spent hours trying to figure this out!!! |
BetaWas this translation helpful?Give feedback.
All reactions
-
This works! Thanks for sharing. Important:
Simply copy what you find in |
BetaWas this translation helpful?Give feedback.
All reactions
-
Works for me - this thread/approach seems super under-rated. I actually don't understand why this is not integrated into next already by default for static output targets. |
BetaWas this translation helpful?Give feedback.