unplugin / unplugin-vue-markdown

Compile Markdown to Vue component
MIT License
508 stars 27 forks source link

Getting ES Module Error #48

Closed yatendra121 closed 5 months ago

yatendra121 commented 5 months ago

Describe the bug

I have added configuration of in vite.config.ts. after then, when i am trying to start development server it has throwing error that given below.

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/yatendrakushwaha/my-workspace/qnx-vuetify-sample/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_blocks.mjs not supported. Instead change the require of /Users/yatendrakushwaha/my-workspace/qnx-vuetify-sample/node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_blocks.mjs to a dynamic import() which is available in all CommonJS modules.

Reproduction

https://github.com/yatendra121/qnx-vuetify-sample/tree/markdown

System Info

Mac, Chrome

Used Package Manager

pnpm

Validations

meteorlxy commented 5 months ago

A bug from mdit-vue after upgrading to markdown-it v14

meteorlxy commented 5 months ago

@yatendra121 Should have been fixed by @mdit-vue/plugin-component@2.1.1. You can try to upgrade your dependency.

yatendra121 commented 5 months ago

@meteorlxy

@yatendra121 Should have been fixed by @mdit-vue/plugin-component@2.1.1. You can try to upgrade your dependency.

It is working now. Thanks for helping me out. But i am facing an issue that codes have not highlighted. i have already tested with different config but the codes are looking simple as text.