tldraw icon indicating copy to clipboard operation
tldraw copied to clipboard

SSR gives obscure error when not wired up correctly

Open linear[bot] opened this issue 1 year ago • 3 comments

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'

linear[bot] avatar Jan 18 '24 09:01 linear[bot]

@mimecuvalo can you remember if this was fixed?

Taha-Hassan-Git avatar Apr 19 '24 08:04 Taha-Hassan-Git

still a bug!

mimecuvalo avatar Apr 19 '24 10:04 mimecuvalo

Resolved this (hopefully!) in #2940

mimecuvalo avatar Jul 23 '24 11:07 mimecuvalo