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

Unmaintained depency @jsdevtools/ono causing issues #63

Open
Misfits09 opened this issue Oct 11, 2024 · 0 comments
Open

Unmaintained depency @jsdevtools/ono causing issues #63

Misfits09 opened this issue Oct 11, 2024 · 0 comments

Comments

@Misfits09
Copy link

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

  1. Create a vite App from scratch
  2. Install @stoplight/elements to the project
  3. Add nodePolyfills with plugin vite-plugin-node-polyfills
  4. Add commonjsOptions: { transformMixedEsModules: true } build option
  5. Install prismjs and add import 'prismjs'; at the top of main.tsx
  6. Try running npm run build or yarn build

Environment

Latest version of elements with @stoplight/json-schema-ref-parser@"^9.2.7"

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

1 participant