ReactTooltip issue while deploying

There is an issue when using ReactTooltip everytime it somehow got deployed last time after a very long struggle today I made some changes just added to const for GitHub and LinkedIn links not even in the jsx containing ReactTooltip but still again I am unable to build it. The previous deploy was also not working correctly as the tooltip used to show everytime not on hover and the position was also wrong

11:15:25 AM: build-image version: d55944c047ef0aee2ac01971edde72cb2a50acfe (focal)
11:15:25 AM: build-image tag: v4.16.1
11:15:25 AM: buildbot version: 0be68edd034c744ad79b207db44f42646b4e8ecb
11:15:25 AM: Fetching cached dependencies
11:15:25 AM: Starting to download cache of 126.3MB
11:15:27 AM: Finished downloading cache in 1.345166343s
11:15:27 AM: Starting to extract cache
11:15:28 AM: Finished extracting cache in 1.505517817s
11:15:28 AM: Finished fetching cache in 2.893780488s
11:15:28 AM: Starting to prepare the repo for build
11:15:28 AM: Preparing Git Reference refs/heads/main
11:15:29 AM: Parsing package.json dependencies
11:15:30 AM: Starting build script
11:15:30 AM: Installing dependencies
11:15:30 AM: Python version set to 2.7
11:15:30 AM: Started restoring cached node version
11:15:31 AM: Finished restoring cached node version
11:15:31 AM: Downloading and installing node v16.19.0…
11:15:31 AM: Downloading https://nodejs.org/dist/v16.19.0/node-v16.19.0-linux-x64.tar.xz
11:15:32 AM: Computing checksum with sha256sum
11:15:32 AM: Checksums matched!
11:15:34 AM: Enabling node corepack
11:15:34 AM: Started restoring cached build plugins
11:15:34 AM: Finished restoring cached build plugins
11:15:34 AM: Attempting ruby version 2.7.2, read from environment
11:15:35 AM: Using ruby version 2.7.2
11:15:35 AM: Using PHP version 8.0
11:15:35 AM: No npm workspaces detected
11:15:35 AM: Started restoring cached node modules
11:15:35 AM: Finished restoring cached node modules
11:15:35 AM: Installing NPM modules using NPM version 8.19.3
11:15:39 AM: changed 4 packages, and audited 1470 packages in 4s
11:15:39 AM: 229 packages are looking for funding
11:15:39 AM: run npm fund for details
11:15:39 AM: 6 high severity vulnerabilities
11:15:39 AM: To address all issues (including breaking changes), run:
11:15:39 AM: npm audit fix --force
11:15:39 AM: Run npm audit for details.
11:15:39 AM: NPM modules installed
11:15:39 AM: Creating package sha
11:15:40 AM: Started restoring cached go cache
11:15:40 AM: Finished restoring cached go cache
11:15:41 AM: go version go1.19.4 linux/amd64
11:15:41 AM: Detected 1 framework(s)
11:15:41 AM: “create-react-app” at version “5.0.1”
11:15:41 AM: Installing missing commands
11:15:41 AM: Verify run directory
11:15:41 AM: Section completed: initializing
11:15:42 AM: ​
11:15:42 AM: Netlify Build
11:15:42 AM: ────────────────────────────────────────────────────────────────
11:15:42 AM: ​
11:15:42 AM: ❯ Version
11:15:42 AM: @netlify/build 29.2.1
11:15:42 AM: ​
11:15:42 AM: ❯ Flags
11:15:42 AM: baseRelDir: true
11:15:42 AM: buildId: 63abd7f3b766bf00083057f5
11:15:42 AM: deployId: 63abd7f3b766bf00083057f7
11:15:42 AM: ​
11:15:42 AM: ❯ Current directory
11:15:42 AM: /opt/build/repo
11:15:42 AM: ​
11:15:42 AM: ❯ Config file
11:15:42 AM: No config file was defined: using default values.
11:15:42 AM: ​
11:15:42 AM: ❯ Context
11:15:42 AM: production
11:15:42 AM: ​
11:15:42 AM: 1. Build command from Netlify app
11:15:42 AM: ────────────────────────────────────────────────────────────────
11:15:42 AM: ​
11:15:42 AM: $ npm run build
11:15:42 AM: > frontend_react@0.1.0 build
11:15:42 AM: > react-scripts build
11:15:44 AM: Creating an optimized production build…
11:15:54 AM: Failed to compile.
11:15:54 AM:
11:15:54 AM: Attempted import error: ‘react-tooltip’ does not contain a default export (imported as ‘ReactTooltip’).
11:15:54 AM: ​
11:15:54 AM: “build.command” failed
11:15:54 AM: ────────────────────────────────────────────────────────────────
11:15:54 AM: ​
11:15:54 AM: Error message
11:15:54 AM: Command failed with exit code 1: npm run build
11:15:54 AM: ​
11:15:54 AM: Error location
11:15:54 AM: In Build command from Netlify app:
11:15:54 AM: npm run build
11:15:54 AM: ​
11:15:54 AM: Resolved config
11:15:54 AM: build:
11:15:54 AM: command: npm run build
11:15:54 AM: commandOrigin: ui
11:15:54 AM: environment:
11:15:54 AM: - REACT_APP_SANITY_PROCESS_ID
11:15:54 AM: - REACT_APP_SANITY_TOKEN
11:15:54 AM: publish: /opt/build/repo/build
11:15:54 AM: publishOrigin: ui
11:15:54 AM: Caching artifacts
11:15:54 AM: Started saving node modules
11:15:54 AM: Finished saving node modules
11:15:54 AM: Started saving build plugins
11:15:54 AM: Finished saving build plugins
11:15:54 AM: Started saving pip cache
11:15:54 AM: Finished saving pip cache
11:15:54 AM: Started saving emacs cask dependencies
11:15:54 AM: Finished saving emacs cask dependencies
11:15:54 AM: Started saving maven dependencies
11:15:54 AM: Finished saving maven dependencies
11:15:54 AM: Started saving boot dependencies
11:15:54 AM: Finished saving boot dependencies
11:15:54 AM: Started saving rust rustup cache
11:15:54 AM: Finished saving rust rustup cache
11:15:54 AM: Started saving go dependencies
11:15:54 AM: Finished saving go dependencies
11:15:55 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
11:15:55 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:15:55 AM: Failing build: Failed to build site
11:15:55 AM: Finished processing build request in 30.075238563s

The error mentions the problem, and if you check your repo:

you’re doing exactly what the error says not to do.

You need to use named imports:

import {Tooltip} from 'react-tooltip'

Even their documentation mentions this: