Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "./themes/affine.css" specifier in "@blocksuite/presets" #8796

Closed
davidkobielski opened this issue Nov 23, 2024 · 1 comment
Closed

Comments

@davidkobielski
Copy link

Hello!
I have Vue app with blocksuite. I want to use editor but I have error with importing css file. Below I pase the error, when I comment this line "import '@blocksuite/presets/themes/affine.css';" the editor is working, just not looking very good, cause of some css lacks.
I would be very grateful for help, thanks!

[plugin:vite:import-analysis] Missing "./themes/affine.css" specifier in "@blocksuite/presets" package
Pre-transform error: Missing "./themes/affine.css" specifier in "@blocksuite/presets" package

Here is my editor.ts file:

import '@blocksuite/presets/themes/affine.css';
import { AffineEditorContainer } from '@blocksuite/presets';
import { Doc, Schema } from '@blocksuite/store';
import { DocCollection } from '@blocksuite/store';
import { AffineSchemas } from '@blocksuite/blocks';

import { effects as blocksEffects } from '@blocksuite/blocks/effects';
import { effects as presetsEffects } from '@blocksuite/presets/effects';

export function initEditor() {

  blocksEffects();
  presetsEffects();
  const schema = new Schema().register(AffineSchemas);
  const collection = new DocCollection({ schema });
  collection.meta.initialize();

  const doc = collection.createDoc({ id: 'page1' });
  doc.load(() => {
    const pageBlockId = doc.addBlock('affine:page', {});
    doc.addBlock('affine:surface', {}, pageBlockId);
    const noteId = doc.addBlock('affine:note', {}, pageBlockId);
    doc.addBlock('affine:paragraph', {}, noteId);
  });

  const editor = new AffineEditorContainer();
  editor.doc = doc;
  return { editor, collection };
}

@miro-ku
Copy link

miro-ku commented Nov 25, 2024

Duplicate of #8451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants