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
when build. mime Error #102
Comments
Does it work using this version range |
reason: the mime version 4 is now pure esm . It cannot be require()'d from CommonJS. |
For your information: |
@thgh - according to the most downloaded versions of rollup-plugin-serve as reported by the npm version history (https://www.npmjs.com/package/rollup-plugin-serve?activeTab=versions) unfortunately I'm using a package that has a subdependancy for rollup-plugin-serve@^1.0.1 hence running into a similar mime error. |
Sure, published the patch in rollup-plugin-serve@1.1.1 just now |
var lite = require('mime/lite');
Error [ERR_REQUIRE_ESM]: require() of ES Module /root/workspace/node16-pnpm8-build/repo/node_modules/.pnpm/registry.npmmirror.com+mime@4.0.0/node_modules/mime/dist/src/index_lite.js from /root/workspace/node16-pnpm8-build/repo/node_modules/.pnpm/registry.npmmirror.com+rollup-plugin-serve@3.0.0/node_modules/rollup-plugin-serve/dist/index.cjs not supported.
Instead change the require of index_lite.js in /root/workspace/node16-pnpm8-build/repo/node_modules/.pnpm/registry.npmmirror.com+rollup-plugin-serve@3.0.0/node_modules/rollup-plugin-serve/dist/index.cjs to a dynamic import() which is available in all CommonJS modules.
code: 'ERR_REQUIRE_ESM'
}
The text was updated successfully, but these errors were encountered: