You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I am attempting to integrate plate 18.14.0 into an existing project I have that is using React 18.2. In this example, I am simply doing import { Plate } from "@udecore/plate". When I build my project, I get compilation warnings as shown in the first screenshot attached. Then when I try to run my project, at run-time I get errors in the console where it is looking for these node packages, as seen in the second screenshot.
Any thoughts on what I am doing wrong here? I'm assuming its something with my build process but I am not sure what I need to adjust
My project is using rollup. I managed to get most things working using the rollup node polyfills plugin, but it doesn't seem to polyfill crypto properly.
Any recs on polyfilling crypto for the browser?
I got it working. PITA to figure out how to get rollup to package Plate properly but this seemed to work for importing Editor from plate/core
adding buffer polyfill package and polyfilling the window like
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
From Speros:
Hi all, I am attempting to integrate plate 18.14.0 into an existing project I have that is using React 18.2. In this example, I am simply doing import { Plate } from "@udecore/plate". When I build my project, I get compilation warnings as shown in the first screenshot attached. Then when I try to run my project, at run-time I get errors in the console where it is looking for these node packages, as seen in the second screenshot.
Any thoughts on what I am doing wrong here? I'm assuming its something with my build process but I am not sure what I need to adjust
My project is using rollup. I managed to get most things working using the rollup node polyfills plugin, but it doesn't seem to polyfill crypto properly.
Any recs on polyfilling crypto for the browser?
I got it working. PITA to figure out how to get rollup to package Plate properly but this seemed to work for importing Editor from plate/core
buffer
polyfill package and polyfilling the window likenodeResolve()
rollup plugin with flagsbrowser: true, preferBuiltins: false
nodePolyfills()
rollup plugin AFTER thecommonjs
plugin in a configbrowser
property because the nodePolyfill plugin one doesn't workBeta Was this translation helpful? Give feedback.
All reactions