testing-library / testing-library/user-event
Package path ./dist/types/utility/type.js is not exported from package
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
NA - Doesn't Build
Prerequisites
npm run build
application-architecture-boilerplate@0.1.0 build
react-scripts build
Creating an optimized production build...
Failed to compile.
Module not found: Error: Package path ./dist/types/utility/type.js is not exported from package /app/node_modules/@testing-library/user-event (see exports field in /app/node_modules/@testing-library/user-event/package.json)
Expected behavior
app/node_modules/@testing-library/user-event/package.json::
{
"name": "@testing-library/user-event",
"version": "14.5.1",
"description": "Fire events the same way the user does",
"keywords": [
"react-testing-library",
"dom-testing-library",
"react",
"testing"
],
"author": "Giorgio Polvara polvara@gmail.com",
"license": "MIT",
"engines": {
"node": ">=12",
"npm": ">=6"
},
"repository": {
"type": "git",
"url": "https://github.com/testing-library/user-event"
},
"bugs": {
"url": "https://github.com/testing-library/user-event/issues"
},
"homepage": "https://github.com/testing-library/user-event#readme",
"files": [
"dist"
],
"scripts": {
"build": "scripts ts-build2 --cjs --target es2019",
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"setup:env": "node --experimental-import-meta-resolve scripts/setup.js",
"test": "kcd-scripts test",
"test:jest": "kcd-scripts test",
"test:toolbox": "NODE_OPTIONS='--experimental-vm-modules --experimental-modules --experimental-import-meta-resolve' node scripts/test.js",
"test:debug": "kcd-scripts --inspect-brk test --runInBand",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts typecheck"
},
"devDependencies": {
"@ph.fritsche/scripts-config": "^2.4.0",
"@ph.fritsche/toolbox": "^1.0.0-alpha.1",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^13.4.0",
"@types/jest-in-case": "^1.0.3",
"@types/react": "^18.0.25",
"@types/sinonjs__fake-timers": "^8.1.2",
"css.escape": "^1.5.1",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-local-rules": "^1.3.2",
"expect": "^28.1.3",
"is-ci": "^3.0.1",
"istanbul-lib-coverage": "^3.2.0",
"istanbul-lib-report": "^3.0.0",
"istanbul-lib-source-maps": "^4.0.1",
"istanbul-reports": "^3.1.5",
"jest-in-case": "^1.0.2",
"jest-mock": "^28.1.3",
"jest-serializer-ansi": "^1.0.3",
"jsdom": "^20.0.3",
"kcd-scripts": "^12.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"shared-scripts": "^1.5.1",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
},
"peerDependencies": {
"@testing-library/dom": ">=7.21.4"
},
"dependencies": {},
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
},
"./dist/cjs/": "./dist/cjs/",
"./dist/esm/": "./dist/esm/"
},
"typesVersions": {
"": {
"dist/types/": [
"./dist/types/"
],
"dist/cjs/.js": [
"./dist/types/.d.ts"
],
"dist/esm/.js": [
"./dist/types/.d.ts"
],
"": [
"./dist/types/*.d.ts"
]
}
}
}
Actual behavior
nom build should succeed
User-event version
14.5.1
Environment
Testing Library framework:
"@testing-library/react": "^13.4.0",
JS framework:
npm --v react
9.6.7
Test environment:
DOM implementation:
Additional context
I just want to npm run build. I don't even use this library in my app.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running npm run build and inspect app/node_modules/@testing-library/user-event/package.json, especially its exports and typesVersions entries. Trace which package path triggers the reported error, then verify that npm run build completes without the package export failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, react, typescript
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100