We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.
import { FOCUSABLE_SELECTOR } from '@testing-library/user-event/dist/esm/utils/index.js'
Module not found: Error: Default condition should be last one
The code should be imported successfully
Get the following error on build: Module not found: Error: Default condition should be last one
14.5.2
Testing Library framework: "@testing-library/jest-dom": "^6.4.0", "@testing-library/react": "^14.2.0", "@testing-library/user-event": "^14.5.2",
JS framework: node v18.17.1 "module": "es6"
Test environment: "vitest": "^1.2.2"
DOM implementation: "jsdom": "^24.0.0"
The error is originated in the package.json found in dist. It has this export:
"exports": { ".": { "types": "./dist/types/index.d.ts", "require": "./dist/cjs/index.js", "default": "./dist/esm/index.js" }, "./dist/cjs/*.js": { "types": "./dist/types/*.d.ts", "import": "./dist/esm/*.js", "default": "./dist/cjs/*.js" }, "./dist/esm/*.js": { "types": "./dist/types/*.d.ts", "default": "./dist/esm/*.js", "require": "./dist/cjs/*.js" } },
and can be fixed by switching the order of the export:
"./dist/esm/*.js": { "types": "./dist/types/*.d.ts", "require": "./dist/cjs/*.js", "default": "./dist/esm/*.js" }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproduction example
.
Prerequisites
import { FOCUSABLE_SELECTOR } from '@testing-library/user-event/dist/esm/utils/index.js'
Module not found: Error: Default condition should be last one
Expected behavior
The code should be imported successfully
Actual behavior
Get the following error on build:
Module not found: Error: Default condition should be last one
User-event version
14.5.2
Environment
Testing Library framework:
"@testing-library/jest-dom": "^6.4.0",
"@testing-library/react": "^14.2.0",
"@testing-library/user-event": "^14.5.2",
JS framework:
node v18.17.1
"module": "es6"
Test environment:
"vitest": "^1.2.2"
DOM implementation:
"jsdom": "^24.0.0"
Additional context
The error is originated in the package.json found in dist. It has this export:
and can be fixed by switching the order of the export:
The text was updated successfully, but these errors were encountered: