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
Package path not exported in Happy-Wrapper #127
Comments
more details please ... what error are you getting. it's working fine for me. you can't expect library authors to clone, pull down deps, and then build and test. Also, please be sure your |
Sorry, here's the error,
|
I had the same problem and solved it, just add "type": "module" in my package.json. |
Yes this is the error a number of folks are having but it's just the one line fix I suggested and it relates to the fact that ViteJS (and esbuild and Rollup too) are both ESM-first bundlers so they like ESM and tolerate CJS. The king of the world for many of the last 10 years was Webpack which was having a love affair with CJS and only let ESM over for brief visits (speaking figuratively of course). Ultimately this means that most of the "defaults" in the JS world today are still CJS but if you're using a ViteJS build system then you can easily switch to ESM and probably should. If you use any ESM only packages which in turn have ESM only dependencies you must switch to ESM. Fortunately that's just a matter of changing your Good luck and welcome to the post-CJS world. |
Adding Maybe this should be added to the readme. A few CJS config files caused some issues when adding |
I have the same problem.But when I adding Problem encountered during the "parser" stage of the vite-plugin-md transform pipeline:
Dynamic require of "file:///Users/.../node_modules/markdown-it-prism/build/index.js" is not supported
... At last,
import MarkdownIt from 'markdown-it';
import prism from 'markdown-it-prism';
import "prismjs/components/prism-clike"
import "prismjs/components/prism-java"
function component() {
const md = new MarkdownIt();
md.use(prism);
const element = document.createElement('div');
element.innerHTML = md.rend
... |
I had a same problem and solved it.but that's lead to another problem. the file of .eslint.js doesn't work, Node.js will treat as CommonJs if the nearest parent package.json file not contains a top-level "type" field with a value of "module". Of course, I have to change the .js to .cjs. it's a little troublesome. |
@puyuchun if your application has module resolution set to |
@duzhipeng are you using the |
The |
@duzhipeng thanks for giving me some more resolution on this. Before the split of this plugin from |
Describe the bug
Cannot run Vite dev server when
vite-plugin-md
is used.Reproduction
https://github.com/emfax/vite-plugin-md-repro
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: