toeverything / blocksuite

🧩 Content editing tech stack for the web - BlockSuite is a toolkit for building editors and collaborative applications.
https://blocksuite.io
Mozilla Public License 2.0
4.11k stars 358 forks source link

Doc load error. TypeError: Cannot read properties of null (reading 'load') #7482

Closed jizhi0v0 closed 2 weeks ago

jizhi0v0 commented 2 weeks ago

It works fine in 0.14.0.

 const schema = new Schema().register(AffineSchemas);
 const collection = new DocCollection({ schema });

 const doc = collection.createDoc({ id: 'page' });
 const editor = new AffineEditorContainer();
 // TypeError: Cannot read properties of null (reading 'load')
 doc.load

 ⨯ node_modules/@blocksuite/blocks/dist/index.js (93:1) @ eval
 ⨯ Internal error: Error: Seems like you are importing @blocksuite/blocks in SSR mode. Which is not supported for now.
    at eval (./node_modules/@blocksuite/blocks/dist/index.js:681:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "4163597053"
  91 | }
  92 | if (typeof window === 'undefined') {
> 93 |     throw new Error('Seems like you are importing @blocksuite/blocks in SSR mode. Which is not supported for now.');
     | ^
  94 | }
  95 | env[importIdentifier] = true;
  96 | //# sourceMappingURL=index.js.map
raymonddaikon commented 2 weeks ago

I believe this is the same issue I'm having in #7481. The collection is not creating a doc for some reason.

fourdim commented 2 weeks ago

Trace this issue in #7481.