Description
Discussed in #12637
Originally posted by mkochman August 5, 2022
Hi 👋
I have a quite strange problem with jsdom. I get it on bitbucket CI:
Validation Error:
Module /opt/atlassian/pipelines/agent/build/node_modules/react-scripts/node_modules/react-app-polyfill/jsdom.js in the setupFiles option was not found.
is: /opt/atlassian/pipelines/agent/build
I checked node_modules and react-scripts and I see in package.json dependency that react-app-polyfill is included but I don't see it in eact-scripts/node_modules 🤔
The code responsible for it is in file scripts/utils/createJestConfig.js
setupFiles: [ isEjecting ? 'react-app-polyfill/jsdom' : require.resolve('react-app-polyfill/jsdom'), ],
I tried to overwrite setupFiles or use separate install of react-app-polyfill but without any success :(
My package.json:
"devDependencies": {
"@babel/cli": "^7.15.7",
"@babel/core": "^7.18.10",
"@babel/eslint-parser": "^7.17.0",
"@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6",
"@playwright/test": "^1.23.1",
"@types/jest": "^27.4.1",
"@types/lodash.get": "^4.4.6",
"@types/node": "^14.14.16",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/uuid": "^8.3.4",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"chromedriver": "^93.0.0",
"edgedriver": "^4.17134.1",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.4.3",
"eslint": "^8.15.0",
"geckodriver": "^3.0.1",
"jest-junit": "^14.0.0",
"jest-watch-typeahead": "^2.0.0",
"mini-css-extract-plugin": "^2.6.1",
"pdfkit": "^0.11.0",
"pretty-format": "^28.1.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "^5.0.1",
"rimraf": "^2.6.3",
"sass": "^1.51.0",
"sass-loader": "^13.0.2",
"selenium-webdriver": "^4.0.0-alpha.5",
"ts-loader": "^8.2.0",
"typescript": "^4.6.4",
"webpack-cli": "^4.10.0",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"bowser": "^2.11.0",
"date-fns": "^1.30.1",
"lodash.get": "^4.4.2",
"prop-types": "^15.7.2",
"react-app-polyfill": "^3.0.0",
"resize-observer-polyfill": "^1.5.1",
"uuid": "^8.3.2"
},
"peerDependencies": {
"react": ">= 16.6.0 < 18.2",
"react-dom": ">= 16.6.0 < 18.2"
},
Maybe it is a problem with library versions? Or maybe with configuration?
I will be grateful for help.