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: require() of ES Module dom-accessibility-api/dist/index.mjs not supported. #1065

Open
c0d3x opened this issue Oct 30, 2024 · 1 comment

Comments

@c0d3x
Copy link

c0d3x commented Oct 30, 2024

When I run vitest on a button.test.jsx file, i get this error:

Error: require() of ES Module .../node_modules/dom-accessibility-api/dist/index.mjs not supported.
Instead change the require of .../node_modules/dom-accessibility-api/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
 ❯ Object.<anonymous> node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/suggestions.js:7:28

Any suggestions? Is it a bug in dom-accessibility-api?

@eps1lon
Copy link
Owner

eps1lon commented Nov 4, 2024

Seems like Vitest is using the module entrypoint instead of the main entrypoint. People are using this library in Vitest already as far as I know. I'd file this against Vitest first to check if there's a config issue or library issue.

Please link the created Vitest issue so that we can track progress.

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

2 participants