I am getting a error while deploying my react app

Hey,

What if you refresh this page? You should see the error being logged out in there.

JΓ©rΓ©my.
Render Support, UTC+3

1 Like

There are two different versions of React being installed:

  • 18.2.0 from @testing-library/react@13.4.0
  • 16.14.0 from react-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 :pensive:. 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
1 Like

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.