nteract / outputs

A collection of React components for displaying rich Jupyter display objects
BSD 3-Clause "New" or "Revised" License
26 stars 19 forks source link

Next.js compatibility #60

Open pakatagoh opened 3 years ago

pakatagoh commented 3 years ago

Hi nteract team,

I'm currently trying to make use of @nteract/jupyter-widgets in a project of mine with Next.js but I'm running into the issue below. I'm wondering if anyone has encountered such an issue and managed to solve it.

Screenshot 2021-02-25 at 17 26 24
captainsafia commented 3 years ago

Thanks for opening this issue, @pakatagoh!

Unfortunately, we don't own the @jupyter-widgets/base component that is being imported by the jupyter-widgets package. What version of next.js are you using? https://github.com/vercel/next.js/issues/12079#issuecomment-690581754 seems to indicate this was fixed in the 9.5.4 release.

pakatagoh commented 3 years ago

currently on V10 of next.js. the setup I have is a lerna managed monorepo where the nextjs project is one of the packages. Not 100% sure if it affects anything.

captainsafia commented 3 years ago

We use a similar setup in the nteract monorepo. However, we don't have ipywidget support included as part of the default app.

I misspoke earlier, the code in question is actually in our codebase.

https://github.com/nteract/outputs/blob/2f0e9bcc405deeb222775cf9b294be510be5ab21/packages/jupyter-widgets/src/renderer/backbone-wrapper.tsx#L9-L14

Would you be interested in trying to update this to use a require instead of an import to see if that resolves the issue?