vite-plugin-md icon indicating copy to clipboard operation
vite-plugin-md copied to clipboard

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

Open XiaoYang943 opened this issue 2 years ago • 7 comments

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.

XiaoYang943 avatar Feb 26 '23 15:02 XiaoYang943

我在我的package.json文件当中加入"type": "module",项目正常启动了,可能依赖包抛弃了以前的模式。 我用的是node 16 的版本 npm 8+

biancangming avatar Mar 02 '23 12:03 biancangming

谢谢!

XiaoYang943 avatar Mar 02 '23 12:03 XiaoYang943

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!

MaGaroo avatar Mar 07 '23 13:03 MaGaroo

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)]
  })

})();


nonzzz avatar Jun 11 '23 12:06 nonzzz

Renaming vite.config.ts to vite.config.mts also worked for me.

kikuomax avatar Dec 02 '23 15:12 kikuomax

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

callmesoul avatar Feb 05 '24 07:02 callmesoul

Translation: My vite-plugin-md version just needs to be reduced to version 0.10.0.

I really feel an obligation to do this.

MaGaroo avatar Feb 07 '24 14:02 MaGaroo