tldraw
tldraw copied to clipboard
SSR gives obscure error when not wired up correctly
Right now you get an error saying:
Cannot find module '[...]/node_modules/core-js/stable/array/at' imported from [...]/node_modules/@tldraw/editor/dist-esm/index.mjs
Did you mean to import core-js/stable/array/at.js?
which is super obscure.
We should proactively tell the developers that they need to wire it correctly and link them to an example.
Btw, the easiest way to repro this is cloning the nextjs example repo: https://github.com/tldraw/examples/tree/main/tldraw-nextjs-example and changing the lines from:
// const Editor = dynamic(() => import('../components/Editor'), { ssr: false })
import Editor from '../components/Editor'
@mimecuvalo can you remember if this was fixed?
still a bug!
Resolved this (hopefully!) in #2940