Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

MultiSelect not working in next js when SSR #94

Open
samthomson opened this issue Jan 3, 2021 · 1 comment
Open

MultiSelect not working in next js when SSR #94

samthomson opened this issue Jan 3, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@samthomson
Copy link

I get an error when I SSR a page containing the SelectMenu control (https://bumbag.style/form/select-menu/).

image

I am using Bumbag with Next JS. I integrated it as per the integrating with next js docs here: https://bumbag.style/getting-started/#usage-with-nextjs

If I comment out the select menu it works, so then I remove my comments and the app builds and I see the control on the page working as expected. Although if I refresh the page (SSR) I get the error.

All other controls work Ok. Do I need to change something to make the Select work specifically with SSR?

"bumbag": "^1.6.10",
"bumbag-server": "^1.5.1",
"next": "^10.0.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",

_app.tsx:

image

@samthomson
Copy link
Author

samthomson commented Jan 3, 2021

I figured out a solution. I added regenerator-runtime as a dependency (yarn add regenerator-runtime) and then import it atop of my _app.tsx file:

import 'regenerator-runtime/runtime'

image

I'm not sure if this should be a dependency or worth adding as a step in the setting up with next-js docs. Or maybe next-js is at fault. Either way, works now.

@jxom jxom added the bug Something isn't working label Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants