RollupError: Could not resolve "./navbars/Topbar.jsx" from "src/components/Tattoos.jsx"

The website is this one: https://techtonikah.netlify.app/

This is the following error:

5:06:38 PM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
5:06:38 PM: build-image tag: v4.16.3
5:06:38 PM: buildbot version: e9e3d43a47e741f8e4bfc543cd4f5a2efea8bed2
5:06:39 PM: Fetching cached dependencies
5:06:39 PM: Starting to download cache of 262.5MB
5:06:40 PM: Finished downloading cache in 981.734517ms
5:06:40 PM: Starting to extract cache
5:06:41 PM: Finished extracting cache in 1.134579264s
5:06:41 PM: Finished fetching cache in 2.170366124s
5:06:41 PM: Starting to prepare the repo for build
5:06:41 PM: Preparing Git Reference refs/heads/main
5:06:41 PM: git clone --filter=blob:none --no-checkout GitHub - missatoy/techtonikah: Web react app created to expose tattoos and visual arts from the independent artist Techtonikah
5:06:42 PM: Parsing package.json dependencies
5:06:43 PM: Starting build script
5:06:43 PM: Installing dependencies
5:06:43 PM: Python version set to 2.7
5:06:43 PM: Started restoring cached Node.js version
5:06:44 PM: Finished restoring cached Node.js version
5:06:44 PM: v16.19.0 is already installed.
5:06:44 PM: Now using node v16.19.0 (npm v8.19.3)
5:06:44 PM: Enabling Node.js Corepack
5:06:44 PM: Started restoring cached build plugins
5:06:44 PM: Finished restoring cached build plugins
5:06:45 PM: Attempting Ruby version 2.7.2, read from environment
5:06:45 PM: Using Ruby version 2.7.2
5:06:45 PM: Using PHP version 8.0
5:06:45 PM: Started restoring cached corepack dependencies
5:06:45 PM: mv: cannot move ‘/opt/build/cache/.node/corepack’ to ‘/opt/buildhome/.node/corepack’: No such file or directory
5:06:45 PM: Finished restoring cached corepack dependencies
5:06:45 PM: Started restoring cached yarn cache
5:06:46 PM: Finished restoring cached yarn cache
5:06:46 PM: No yarn workspaces detected
5:06:46 PM: Started restoring cached node modules
5:06:46 PM: Finished restoring cached node modules
5:06:46 PM: Installing npm packages using Yarn version 1.22.19
5:06:46 PM: yarn install v1.22.19
5:06:46 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
5:06:46 PM: [1/4] Resolving packages…
5:06:47 PM: [2/4] Fetching packages…
5:06:47 PM: [3/4] Linking dependencies…
5:06:47 PM: [4/4] Building fresh packages…
5:06:47 PM: success Saved lockfile.
5:06:47 PM: Done in 0.82s.
5:06:47 PM: npm packages installed using Yarn
5:06:47 PM: Started restoring cached go cache
5:06:47 PM: Finished restoring cached go cache
5:06:48 PM: Installing Go version 1.19.5 (requested 1.19.x)
5:06:54 PM: unset GOOS;
5:06:54 PM: unset GOARCH;
5:06:54 PM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.19.5.linux.amd64’;
5:06:54 PM: export PATH=“/opt/buildhome/.gimme/versions/go1.19.5.linux.amd64/bin:${PATH}”;
5:06:54 PM: go version >&2;
5:06:54 PM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.19.5.linux.amd64.env”
5:06:54 PM: go version go1.19.5 linux/amd64
5:06:54 PM: Detected 1 framework(s)
5:06:54 PM: “vite” at version “4.0.0”
5:06:54 PM: Installing missing commands
5:06:54 PM: Verify run directory
5:06:54 PM: Section completed: initializing
5:06:56 PM: ​
5:06:56 PM: Netlify Build
5:06:56 PM: ────────────────────────────────────────────────────────────────
5:06:56 PM: ​
5:06:56 PM: ❯ Version
5:06:56 PM: @netlify/build 29.5.0
5:06:56 PM: ​
5:06:56 PM: ❯ Flags
5:06:56 PM: baseRelDir: true
5:06:56 PM: buildId: 63c8271dcb998200080f3014
5:06:56 PM: deployId: 63c8271dcb998200080f3016
5:06:56 PM: ​
5:06:56 PM: ❯ Current directory
5:06:56 PM: /opt/build/repo
5:06:56 PM: ​
5:06:56 PM: ❯ Config file
5:06:56 PM: /opt/build/repo/netlify.toml
5:06:56 PM: ​
5:06:56 PM: ❯ Context
5:06:56 PM: production
5:06:56 PM: ​
5:06:56 PM: ❯ Installing plugins
5:06:56 PM: - @netlify/plugin-emails@1.0.0
5:06:57 PM: ​
5:06:57 PM: ❯ Loading plugins
5:06:57 PM: - @netlify/plugin-emails@1.0.0 from Netlify app
5:06:58 PM: ​
5:06:58 PM: 1. @netlify/plugin-emails (onPreBuild event)
5:06:58 PM: ────────────────────────────────────────────────────────────────
5:06:58 PM: ​
5:06:58 PM: ​
5:06:58 PM: (@netlify/plugin-emails onPreBuild completed in 16ms)
5:06:58 PM: ​
5:06:58 PM: 2. Build command from Netlify app
5:06:58 PM: ────────────────────────────────────────────────────────────────
5:06:58 PM: ​
5:06:58 PM: $ yarn build
5:06:58 PM: yarn run v1.22.19
5:06:59 PM: $ vite build
5:06:59 PM: vite v4.0.0 building for production…
5:06:59 PM: transforming…
5:06:59 PM: ✓ 28 modules transformed.
5:06:59 PM: Could not resolve “./navbars/Topbar.jsx” from “src/components/Tattoos.jsx”
5:06:59 PM: file: /opt/build/repo/src/components/Tattoos.jsx
> 5:06:59 PM: error during build:
> 5:06:59 PM: RollupError: Could not resolve “./navbars/Topbar.jsx” from “src/components/Tattoos.jsx”
> 5:06:59 PM: at error (file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:2001:30)
> 5:06:59 PM: at ModuleLoader.handleInvalidResolvedId (file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:22855:24)
> 5:06:59 PM: at file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:22818:26
> 5:06:59 PM: error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
> 5:06:59 PM: info Visit yarn run | Yarn for documentation about this command.
> 5:06:59 PM: ​
> 5:06:59 PM: “build.command” failed **
> 5:06:59 PM: ────────────────────────────────────────────────────────────────
> 5:06:59 PM: ​
> 5:06:59 PM: Error message
> 5:06:59 PM: Command failed with exit code 1: yarn build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
> 5:06:59 PM: ​
> 5:06:59 PM: Error location
> 5:06:59 PM: In Build command from Netlify app:
> 5:06:59 PM: yarn build
> 5:06:59 PM: ​
> 5:06:59 PM: Resolved config
> 5:06:59 PM: build:
> 5:06:59 PM: command: yarn build
> 5:07:00 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
> 5:06:59 PM: commandOrigin: ui
> 5:06:59 PM: environment:
> 5:06:59 PM: - NETLIFY_EMAILS_DIRECTORY
> 5:06:59 PM: - NETLIFY_EMAILS_SECRET
> 5:06:59 PM: publish: /opt/build/repo/dist
> 5:06:59 PM: publishOrigin: ui
> 5:06:59 PM: functions:
> 5:06:59 PM: emails:
> 5:06:59 PM: external_node_modules:
> 5:06:59 PM: - node-fetch@2
> 5:06:59 PM: included_files:
> 5:07:00 PM: - ./emails/ plugins: - inputs: {} origin: ui package: ‘@netlify/plugin-emails’ redirects: - from: /
status: 200 to: /index.html redirectsOrigin: configCaching artifacts
*
5:07:00 PM: Started saving node modules
5:07:00 PM: Finished saving node modules
5:07:00 PM: Started saving build plugins
5:07:00 PM: Finished saving build plugins
5:07:00 PM: Started saving yarn cache
5:07:00 PM: Finished saving yarn cache
5:07:00 PM: Started saving pip cache
5:07:00 PM: Finished saving pip cache
5:07:00 PM: Started saving emacs cask dependencies
5:07:00 PM: Finished saving emacs cask dependencies
5:07:00 PM: Started saving maven dependencies
5:07:00 PM: Finished saving maven dependencies
5:07:00 PM: Started saving boot dependencies
5:07:00 PM: Finished saving boot dependencies
5:07:00 PM: Started saving rust rustup cache
5:07:00 PM: Finished saving rust rustup cache
5:07:00 PM: Started saving go dependencies
5:07:00 PM: Finished saving go dependencies
5:07:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:07:00 PM: Failing build: Failed to build site
5:07:00 PM: Finished processing build request in 21.781632421s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

Hey Sam,

I trie do search around the forum but I didn’t know exaclty what or how to search, I’m sorry. Reading the log for me at this point wasn’t very helpful, I’ve been trying for a few days to solve this issue and this was my last resource :melting_face:

Also, I believe the build problem started when I implemented emailjs a nutshell from React to handle forms and send them to email.

Anyway, here is my package.json:

{
“name”: “techtonikah”,
“private”: true,
“version”: “0.0.0”,
“type”: “module”,
“scripts”: {
“dev”: “vite”,
“build”: “vite build”,
“preview”: “vite preview”
},
“dependencies”: {
“emailjs-com”: “^3.2.0”,
“esbuild”: “0.16.4”,
“react”: “^18.2.0”,
“react-dom”: “^18.2.0”,
“react-router-dom”: “^6.4.5”
},
“devDependencies”: {
@types/react”: “^18.0.26”,
@types/react-dom”: “^18.0.9”,
@vitejs/plugin-react”: “^3.0.0”,
“vite”: “^4.0.0”
}
}

I think this is your problem . The most important thing if you publish your package is the name and versions fields as they are required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version.

have you solved the problem, i have the same problem as you

Please refer to: