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

Nextjs SSR example #46

Open
sne11ius opened this issue Nov 4, 2018 · 4 comments
Open

Nextjs SSR example #46

sne11ius opened this issue Nov 4, 2018 · 4 comments

Comments

@sne11ius
Copy link

sne11ius commented Nov 4, 2018

This is not a real "issue", but rather a suggestion: a minimal example of how to use firestorter with nextjs and SSR would be awesome ;)

@IjzerenHein
Copy link
Owner

Great idea. It's not on my prio list at the moment, so contributions would be very helpful for this.
Cheers!

@RWOverdijk
Copy link

Did either of you happen to do this yet? I'm trying to get it working now and... Well, let's just say it's not.

firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error:....

etc.

@RWOverdijk
Copy link

Looking into this, I think that perhaps firestorter or even mobx wouldn't make sense with next.js.

I found this article which explains how you could use mobx in next, but it feels clunky to me.

Zeit's swr seems capable of listeners and such as well. Working with small functional components with swr should yield the same result as working with firestorter and mobx.

By this I mean that you could set up a new onSnapshot listener on a collection/document and use swr's mutate to maintain it locally (so, use Mode.On basically).

To make it "smart" it'd have to be an effect with counters to check if anyone is observing though, so something could be done there.

But if all that is needed is a check to see if anyone is listening to the data I wouldn't use mobx for that. It's a pretty large library for something that could be solved with useEffect. The obvious downside is that you basically have to use hook. But that doesn't seem avoidable anymore anyway so... Why not.

I hope my ramblings help anyone. If not, well, at least I got to ramble.

@thirdman
Copy link

I'm also getting the Error: firestorter: cannot get firestore: Error: firest... issue with next.js, so just arrived here from google. :D I'm not sure where to init, since I'm basically recreating an app that works in firebase hosting.

Just want to say I enjoyed your ramble.

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

4 participants