NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.77k stars 554 forks source link

Polifill problems with React #450

Open Santiago-Peraza opened 1 year ago

Santiago-Peraza commented 1 year ago

Description

I have a lot of problem with this module. Im trying use in react, when compile, i have multiple BREAKING CHANGE error ( exaclty,23). All errors refer to 'webpack<5 used to include polyfills'

i install all dependecies but the errors persist.

polyfills require: stream, tls, net, http2, http, https, zlib, os, dns

Any idea how to solve it?

i have: webpack : 5.76.1 node: 19.7.0

fdterr commented 1 year ago

+1 also getting these errors

colek319 commented 1 year ago

Most of these libraries aren't difficult to polyfill, but http2 doesn't seem to have an implementation that can be used as a polyfill. It really makes this library unusable if you running strictly in browser.

The problems are mostly coming through got. It seems like this is meant to run only in a node.js environment anyway, according to this issue.

The way around this is to implement an http2 polyfill, or to run everything in a node environment (server-side rendering would work really well here).

Thoughts on a path forwar? Could we use another http library? They recommend ky for browser. That said, maybe we shouldn't be doing this in browser at all.