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

prismjs import error - require is not define #124

Open
2 tasks done
nepaul opened this issue Sep 24, 2023 · 1 comment
Open
2 tasks done

prismjs import error - require is not define #124

nepaul opened this issue Sep 24, 2023 · 1 comment
Assignees

Comments

@nepaul
Copy link

nepaul commented Sep 24, 2023

  • Searched existing issues to avoid creating duplicates.

  • Confirmed that it can be reproduced in muya.


Describe the bug

When I integrated "muya" into my project, the following error occurred (I'm using the latest version of npm - "@marktext/muya": "^0.2.1",).

This seems to be a common error with Vite.

Unknown variable dynamic import: ../../../node_modules/prisms/components/prism-latex.js te: July at eval (webpack-internal:///../muya/dist/chunks/emptyStates. cbb949b2.js:2179:86)

Unknown variable dynamic import: ../../.. /node_modules /prismjs/components/prism-yaml.js

require is not defined
ReferenceError: require is not defined
at eval (webpack-internal:/// ../muva/dist/chunks/prism-keep-markup.6f6991cb.is:2:1)
at . . /mua/dist/chunks/prism-keep-markup.6f6991cb.js(http://localhost:3000/js/muya_dist_chunks_prism-keep-markup_6f6991cb_js.js:18:1)
at webpack_require.
(http://localhost:3000/js/app.is:737:33)
at Function. fn (http://localhost:3000/js/app.js: 1110:21)

To Reproduce
Steps to reproduce the behavior:

import Muya from '@marktext/muya';
import {
  EmojiSelector,
  InlineFormatToolbar,
  ImageEditTool,
  ImageToolBar,
  ImageResizeBar,
  CodeBlockLanguageSelector,
  TableColumnToolbar,
  ParagraphQuickInsertMenu,
  TableDragBar,
  TableRowColumMenu,
  PreviewToolBar,
  ParagraphFrontButton,
  ParagraphFrontMenu,
} from '@marktext/muya/dist/ui/index';

Expected behavior
A clear and concise description of what you expected to happen.

Actual behavior
The actual result of this bug

Operation System and Browser version (please complete the following information):

  • OS: macOS Ventura 13.6
  • Browser: [ Chrome Version 116.0.5845.187 (arm64)]

Muya Version
"^0.2.1"

@Jocs Jocs self-assigned this Sep 26, 2023
@Jocs
Copy link
Member

Jocs commented Sep 27, 2023

I can't reproduce this problem, upgrade node and vite to the latest version to try?

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

No branches or pull requests

2 participants