Skip to content
Discussion options

You must be logged in to vote

After significant investigation I've found a viable workaround.

Firstly, there doesn't seem to be any way around this restriction as it's implemented both in a Webpack plugin (which can be disabled) and in Next.js's Rust-based React Server Components transformer (which can't be disabled).

Using a require statement instead of import worked from within Next.js, but I was no longer able to execute this same code directly from Node.js which in this case I needed to do.

I also tried using Preact as an alternative to render my HTML, but it doesn't appear to be possible to use both React and Preact in the same project.

The solution which did work for me is to asynchronously import the react-dom/…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tobico
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants