Hey,
What if you refresh this page? You should see the error being logged out in there.
JΓ©rΓ©my.
Render Support, UTC+3
There are two different versions of React being installed:
18.2.0
from@testing-library/react@13.4.0
16.14.0
fromreact-typical@0.1.3
These are in conflict with one another and must be resolved.
As the error log provides, you may attempt to resolve this by passing ---legacy-peer-deps
to your npm install
. The error also indicates that this may potentially cause issues.
However, thereβs a newer method introduced in NPM v8.3.0 that appears to be preferred: overrides. Using overrides, you may override a dependency that is resolved for a specified package. Here, react-typical
has a peer dependency of an earlier version of React.
To override this, you may add an overrides
property to your projectβs package.json
:
"overrides": {
"react-typical": {
"react": "^18.0.0"
}
}
Thank you for your response, but I tried both of the solutions but nothing worked . Here is my package.json file:
{
"name": "portfolio",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react-typical": "^0.1.3",
"web-vitals": "^2.1.4",
"yarn": "^1.22.21"
},
"overrides": {
"react-typical": {
"react": "^18.0.0"
}
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"install": "npm install --legacy-peer-deps"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Trying it myself, I was noticing continued issues even with overrides
and --legacy-peer-deps
, too. After playing around with it for a bit, I settled on an iteration that seems to make npm happy without resorting to legacy peer dependencies.
This only contains enough of the configuration to illustrate the modifications necessary and so does not contain any of your other packages or configuration.
package.json
"devDependencies": {
"@testing-library/react": "^14.2.1"
},
"dependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-typical": "^0.1.3"
},
"overrides": {
"react-typical": {
"react": "$react",
"react-dom": "$react-dom"
}
}
Output of npm ls --all
react-typical-test@1.0.0
βββ¬ @testing-library/react@14.2.1
β βββ¬ @babel/runtime@7.24.0
β β βββ regenerator-runtime@0.14.1
β βββ¬ @testing-library/dom@9.3.4
β β βββ¬ @babel/code-frame@7.23.5
β β β βββ¬ @babel/highlight@7.23.4
β β β β βββ @babel/helper-validator-identifier@7.22.20
β β β β βββ¬ chalk@2.4.2
β β β β β βββ¬ ansi-styles@3.2.1
β β β β β β βββ¬ color-convert@1.9.3
β β β β β β βββ color-name@1.1.3
β β β β β βββ escape-string-regexp@1.0.5 deduped
β β β β β βββ¬ supports-color@5.5.0
β β β β β βββ has-flag@3.0.0
β β β β βββ js-tokens@4.0.0 deduped
β β β βββ¬ chalk@2.4.2
β β β βββ¬ ansi-styles@3.2.1
β β β β βββ¬ color-convert@1.9.3
β β β β βββ color-name@1.1.3
β β β βββ escape-string-regexp@1.0.5
β β β βββ¬ supports-color@5.5.0
β β β βββ has-flag@3.0.0
β β βββ @babel/runtime@7.24.0 deduped
β β βββ @types/aria-query@5.0.4
β β βββ¬ aria-query@5.1.3
β β β βββ¬ deep-equal@2.2.3
β β β βββ¬ array-buffer-byte-length@1.0.1
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ is-array-buffer@3.0.4 deduped
β β β βββ¬ call-bind@1.0.7
β β β β βββ¬ es-define-property@1.0.0
β β β β β βββ get-intrinsic@1.2.4 deduped
β β β β βββ es-errors@1.3.0
β β β β βββ function-bind@1.1.2
β β β β βββ get-intrinsic@1.2.4 deduped
β β β β βββ¬ set-function-length@1.2.2
β β β β βββ¬ define-data-property@1.1.4
β β β β β βββ es-define-property@1.0.0 deduped
β β β β β βββ es-errors@1.3.0 deduped
β β β β β βββ gopd@1.0.1 deduped
β β β β βββ es-errors@1.3.0 deduped
β β β β βββ function-bind@1.1.2 deduped
β β β β βββ get-intrinsic@1.2.4 deduped
β β β β βββ gopd@1.0.1 deduped
β β β β βββ¬ has-property-descriptors@1.0.2
β β β β βββ es-define-property@1.0.0 deduped
β β β βββ¬ es-get-iterator@1.1.3
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ get-intrinsic@1.2.4 deduped
β β β β βββ has-symbols@1.0.3
β β β β βββ is-arguments@1.1.1 deduped
β β β β βββ is-map@2.0.3
β β β β βββ is-set@2.0.3
β β β β βββ¬ is-string@1.0.7
β β β β β βββ has-tostringtag@1.0.2 deduped
β β β β βββ isarray@2.0.5 deduped
β β β β βββ¬ stop-iteration-iterator@1.0.0
β β β β βββ¬ internal-slot@1.0.7
β β β β βββ es-errors@1.3.0 deduped
β β β β βββ hasown@2.0.2 deduped
β β β β βββ side-channel@1.0.6 deduped
β β β βββ¬ get-intrinsic@1.2.4
β β β β βββ es-errors@1.3.0 deduped
β β β β βββ function-bind@1.1.2 deduped
β β β β βββ has-proto@1.0.3
β β β β βββ has-symbols@1.0.3 deduped
β β β β βββ¬ hasown@2.0.2
β β β β βββ function-bind@1.1.2 deduped
β β β βββ¬ is-arguments@1.1.1
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ¬ has-tostringtag@1.0.2
β β β β βββ has-symbols@1.0.3 deduped
β β β βββ¬ is-array-buffer@3.0.4
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ get-intrinsic@1.2.4 deduped
β β β βββ¬ is-date-object@1.0.5
β β β β βββ has-tostringtag@1.0.2 deduped
β β β βββ¬ is-regex@1.1.4
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ has-tostringtag@1.0.2 deduped
β β β βββ¬ is-shared-array-buffer@1.0.3
β β β β βββ call-bind@1.0.7 deduped
β β β βββ isarray@2.0.5
β β β βββ¬ object-is@1.1.6
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ¬ define-properties@1.2.1
β β β β βββ define-data-property@1.1.4 deduped
β β β β βββ has-property-descriptors@1.0.2 deduped
β β β β βββ object-keys@1.1.1 deduped
β β β βββ object-keys@1.1.1
β β β βββ¬ object.assign@4.1.5
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ define-properties@1.2.1 deduped
β β β β βββ has-symbols@1.0.3 deduped
β β β β βββ object-keys@1.1.1 deduped
β β β βββ¬ regexp.prototype.flags@1.5.2
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ define-properties@1.2.1 deduped
β β β β βββ es-errors@1.3.0 deduped
β β β β βββ¬ set-function-name@2.0.2
β β β β βββ define-data-property@1.1.4 deduped
β β β β βββ es-errors@1.3.0 deduped
β β β β βββ functions-have-names@1.2.3
β β β β βββ has-property-descriptors@1.0.2 deduped
β β β βββ¬ side-channel@1.0.6
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ es-errors@1.3.0 deduped
β β β β βββ get-intrinsic@1.2.4 deduped
β β β β βββ object-inspect@1.13.1
β β β βββ¬ which-boxed-primitive@1.0.2
β β β β βββ¬ is-bigint@1.0.4
β β β β β βββ has-bigints@1.0.2
β β β β βββ¬ is-boolean-object@1.1.2
β β β β β βββ call-bind@1.0.7 deduped
β β β β β βββ has-tostringtag@1.0.2 deduped
β β β β βββ¬ is-number-object@1.0.7
β β β β β βββ has-tostringtag@1.0.2 deduped
β β β β βββ is-string@1.0.7 deduped
β β β β βββ¬ is-symbol@1.0.4
β β β β βββ has-symbols@1.0.3 deduped
β β β βββ¬ which-collection@1.0.2
β β β β βββ is-map@2.0.3 deduped
β β β β βββ is-set@2.0.3 deduped
β β β β βββ is-weakmap@2.0.2
β β β β βββ¬ is-weakset@2.0.3
β β β β βββ call-bind@1.0.7 deduped
β β β β βββ get-intrinsic@1.2.4 deduped
β β β βββ¬ which-typed-array@1.1.15
β β β βββ¬ available-typed-arrays@1.0.7
β β β β βββ possible-typed-array-names@1.0.0
β β β βββ call-bind@1.0.7 deduped
β β β βββ¬ for-each@0.3.3
β β β β βββ is-callable@1.2.7
β β β βββ¬ gopd@1.0.1
β β β β βββ get-intrinsic@1.2.4 deduped
β β β βββ has-tostringtag@1.0.2 deduped
β β βββ¬ chalk@4.1.2
β β β βββ¬ ansi-styles@4.3.0
β β β β βββ¬ color-convert@2.0.1
β β β β βββ color-name@1.1.4
β β β βββ¬ supports-color@7.2.0
β β β βββ has-flag@4.0.0
β β βββ dom-accessibility-api@0.5.16
β β βββ lz-string@1.5.0
β β βββ¬ pretty-format@27.5.1
β β βββ ansi-regex@5.0.1
β β βββ ansi-styles@5.2.0
β β βββ react-is@17.0.2
β βββ¬ @types/react-dom@18.2.22
β β βββ¬ @types/react@18.2.66
β β βββ @types/prop-types@15.7.11
β β βββ @types/scheduler@0.16.8
β β βββ csstype@3.1.3
β βββ react-dom@18.2.0 deduped
β βββ react@18.2.0 deduped
βββ¬ react-dom@18.2.0 overridden
β βββ¬ loose-envify@1.4.0
β β βββ js-tokens@4.0.0
β βββ react@18.2.0 deduped
β βββ¬ scheduler@0.23.0
β βββ loose-envify@1.4.0 deduped
βββ¬ react-typical@0.1.3 overridden
β βββ @camwiegert/typical@0.1.1
β βββ¬ prop-types@15.8.1
β β βββ loose-envify@1.4.0 deduped
β β βββ object-assign@4.1.1
β β βββ react-is@16.13.1
β βββ react-dom@18.2.0 deduped
β βββ react@18.2.0 deduped
βββ¬ react@18.2.0 overridden
βββ loose-envify@1.4.0 deduped
thank you it worked but I got another error : Ran out of memory (used over 8GB) while building your code.
You likely want to open a new thread for that issue since
- it departs from the original issue
- this thread is marked as solved (which also means fewer people will look at it)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.