Open
Description
When using @stoplightio/elements with Vite.js it is not possible to build the because of the unmaintained @jsdevtools/ono
. I figured it should be replaced by a more fitting alternative.
Current Behavior
When building elements with vite, I get the error can't convert undefined to object
coming from these lines in "@jsdevtools/ono" bundles:
// CommonJS default export hack
if (typeof module === "object" && typeof module.exports === "object") {
module.exports = Object.assign(module.exports.default, module.exports);
}
Expected Behavior
Use a maintained repository from error handling
Possible Workaround/Solution
Only solution is to replace this dependency by an empty one in Vite config but that could cause some issues... As I described here
Steps to Reproduce
- Create a vite App from scratch
- Install @stoplight/elements to the project
- Add
nodePolyfills
with pluginvite-plugin-node-polyfills
- Add
commonjsOptions: { transformMixedEsModules: true }
build option - Install
prismjs
and addimport 'prismjs';
at the top of main.tsx - Try running
npm run build
oryarn build
Environment
Latest version of elements with @stoplight/json-schema-ref-parser@"^9.2.7"
Metadata
Metadata
Assignees
Labels
No labels