vite-plugin-md
vite-plugin-md copied to clipboard
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
Describe the bug
failed to load config from ...\vite.config.ts error when starting dev server:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in ...\node_modules@yankeeinlondon\happy-wrapper\package.json
help!thanks!
Reproduction
npm
System Info
system
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
我在我的package.json文件当中加入"type": "module",
项目正常启动了,可能依赖包抛弃了以前的模式。
我用的是node 16 的版本
npm 8+
谢谢!
Just in case anyone like me couldn't understand our Chinese friend, here's a translation of his message:
I added "type": "module" to my package.json file, and the project started normally, maybe the dependent package abandoned the previous mode. I am using the node 16 version
Also, the second one simply said:
Thanks!
Another way.happy-wrapper
is a pue esm package. So we can use dynamic import load this plugin.
Here is example:
import { defineConfig } from 'vite';
export default (async () => {
const Markdown = (await import('vite-plugin-md')).default;
return defineConfig({
plugins:[others plugin,Markdown(...yourOption)]
})
})();
Renaming vite.config.ts
to vite.config.mts
also worked for me.
我vite-plugin-md版本降到0.10.0版本就可以了
Translation: My vite-plugin-md version just needs to be reduced to version 0.10.0.
I really feel an obligation to do this.