Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Server side rendering integration #4

Closed
junshengpierre opened this issue Jan 15, 2018 · 14 comments
Closed

Server side rendering integration #4

junshengpierre opened this issue Jan 15, 2018 · 14 comments

Comments

@junshengpierre
Copy link

junshengpierre commented Jan 15, 2018

Hi, does bugsnag-react support SSR?
I followed the installation instructions but get the error:

Bugsnag Error: "bugsnag-js" is for browser JavaScript only.
  For node, use the "bugsnag" package.

when the initial app is rendered on the server with Next.js. If so, how can I integrate it?

Thanks.

@bengourley
Copy link
Contributor

Hi @junshengpierre! bugsnag-js is specific to browsers so it won't be able to help with things rendered on the server.

For anything that runs on a node server, you will need to integrate bugsnag (node). From a quick search of next.js's issues, it seems that there isn't a convention on what to do about "universal" error reporting yet… (e.g. vercel/next.js#1852).

In the future we intend to merge the two bugsnag modules such that issues like this don't happen. But until then and with fledgling (albeit great!) ecosystems like that of next.js, things will always be a little rough around the edges until experimentation has made way for convention!

@junshengpierre
Copy link
Author

Hi @bengourley, thank you for the quick reply. I've managed to successfully integrate bugsnag (node) on the server-side on the project. Alright, I'll experiment and keep a lookout for future updates! Thanks!

@arild-jacobsen
Copy link

How did you solve it @junshengpierre?

@dcalhoun
Copy link

@bengourley is support for SSR something your team intends to build for bugsnag-react in 2018? There is nothing specific to Next.js (or any other SSR frameworks) preventing this work from being done, correct?

Regardless, would it be worthwhile to reopen this ticket if you do intend to build it eventually?

Thanks!

@bengourley
Copy link
Contributor

@dcalhoun we're working on unifying the node/browser notifiers as we speak. See the universal branch on bugsnag-js if you want to be nosy!)

Once that is released, SSR support will be possible.

@BrandonZacharie
Copy link

I agree with @dcalhoun on reopening this ticket

@BrandonZacharie
Copy link

@bengourley is there a rough ETA for this? I have a deadline in November. If this will be ready (even if only as a prerelease), I will use this then (or now if the API is stable enough).

@bengourley
Copy link
Contributor

We should have a prerelease ready by mid september.

@wbw20
Copy link

wbw20 commented Sep 23, 2018

thank you for working on this, do you think it will be ready soon? :)

@bengourley
Copy link
Contributor

It's almost in an alpha state. The platforms team here has had some other priorities so that estimate has moved a bit. We're at the stage of documentation and internal testing now 🙂

@concept47
Copy link

Hey @bengourley. Just wanted to do a quick check to see if you had any updates on this, trying to use bugsnag on a next.js/react project and came across this thread.

@bengourley
Copy link
Contributor

Hey @concept47, we have a Next.js example ready to go when the universal js notifier is released. We are very close now, should be next week. The example project should give you plenty to go on but the docs won't be live until the release.

@kbateman
Copy link

in the _error.js in the the next.js example we seem to get some issues from relativeLocation issues (when using page anchors). Would it be better to dynamically require the bugsnagClient if the initialProps has ctx.err rather than always attempt to load it even if not an err ?

@bengourley
Copy link
Contributor

@kbateman dynamic require doesn't sound like a good idea to me, I would need to be convinced as to why that would help.

Can you open up a specific issue on @bugsnag/js detailing this problem (steps to reproduce, screenshots, reduced test case if possible). Thanks!

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

8 participants