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

Error [ERR_PACKAGE_PATH_NOT_EXPORTED] #133

Open
5 tasks done
XiaoYang943 opened this issue Feb 26, 2023 · 7 comments
Open
5 tasks done

Error [ERR_PACKAGE_PATH_NOT_EXPORTED] #133

XiaoYang943 opened this issue Feb 26, 2023 · 7 comments

Comments

@XiaoYang943
Copy link

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

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@biancangming
Copy link

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

@XiaoYang943
Copy link
Author

谢谢!

@MaGaroo
Copy link

MaGaroo commented Mar 7, 2023

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!

@nonzzz
Copy link
Contributor

nonzzz commented Jun 11, 2023

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

})();

@kikuomax
Copy link

kikuomax commented Dec 2, 2023

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

@callmesoul
Copy link

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

@MaGaroo
Copy link

MaGaroo commented Feb 7, 2024

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

I really feel an obligation to do this.

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

6 participants