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

安装后,运行项目报错 #139

Open
jianggangsheng opened this issue Jun 30, 2023 · 2 comments
Open

安装后,运行项目报错 #139

jianggangsheng opened this issue Jun 30, 2023 · 2 comments

Comments

@jianggangsheng
Copy link

package.json

 "vite-plugin-md": "^0.22.5",

vite.config.ts

import markdown from "vite-plugin-md"
export default defineConfig({
  plugins: [
    vue({
      include: [/\.vue$/, /\.md$/] // <--
    }),
 ],
})

运行vite项目

sudo npm run dev

错误如下

failed to load config from /Users/test/www/kqt/web/vite.config.ts

error when starting dev server:                                                                                                                                                                     16:36:59
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/test/www/kqt/web/node_modules/@yankeeinlondon/happy-wrapper/package.json
    at new NodeError (node:internal/errors:399:5)
    at exportsNotFound (node:internal/modules/esm/resolve:361:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:641:13)
    at resolveExports (node:internal/modules/cjs/loader:565:36)
    at Module._findPath (node:internal/modules/cjs/loader:634:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/Users/test/www/kqt/web/node_modules/vite-plugin-md/dist/index.cjs:18030:28)

@lzdml
Copy link

lzdml commented Aug 2, 2023

这个错误通常是因为你安装的 vite-plugin-md 版本较新,而插件依赖的其他库的版本较旧,导致在处理 ES Module 的导出时出现问题。

@callmesoul
Copy link

vite-plugin-md版本降到0.10.0版本就可以了

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

3 participants