Error with some of my component

Hello i will try to use my best English :S

I have a problem to deploy my website(Portfolio) " spiffy-sawine-904890 "

Error start in building . I don’t know why but in local i have no problem

I share you the logs of deploy :


11:09:29 AM: build-image version: 3b96229e32b19cdf63f20dc1fc9331cd240c2d01 (focal)
11:09:29 AM: buildbot version: 3b96229e32b19cdf63f20dc1fc9331cd240c2d01
11:09:29 AM: Fetching cached dependencies
11:09:29 AM: Failed to fetch cache, continuing with build
11:09:29 AM: Starting to prepare the repo for build
11:09:29 AM: No cached dependencies found. Cloning fresh repo
11:09:29 AM: git clone --filter=blob:none GitHub - FredMeziere/ReactPortfolio: Repos de mon portfolio
11:09:29 AM: Preparing Git Reference refs/heads/main
11:09:32 AM: Starting to install dependencies
11:09:32 AM: Python version set to 3.8
11:09:32 AM: Attempting Ruby version 2.7.2, read from environment
11:09:33 AM: Using Ruby version 2.7.2
11:09:33 AM: Started restoring cached go cache
11:09:33 AM: Finished restoring cached go cache
11:09:33 AM: go version go1.19.10 linux/amd64
11:09:34 AM: Using PHP version 8.0
11:09:35 AM: v18.16.0 is already installed.
11:09:35 AM: Now using node v18.16.0 (npm v9.5.1)
11:09:35 AM: Enabling Node.js Corepack
11:09:35 AM: Started restoring cached build plugins
11:09:35 AM: Finished restoring cached build plugins
11:09:35 AM: Started restoring cached corepack dependencies
11:09:35 AM: Finished restoring cached corepack dependencies
11:09:36 AM: Started restoring cached yarn cache
11:09:36 AM: Finished restoring cached yarn cache
11:09:36 AM: No yarn workspaces detected
11:09:36 AM: Started restoring cached node modules
11:09:36 AM: Finished restoring cached node modules
11:09:36 AM: Installing npm packages using Yarn version 1.22.19
11:09:36 AM: yarn install v1.22.19
11:09:36 AM: warning package.json: No license field
11:09:36 AM: 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.
11:09:36 AM: warning react-modele: No license field
11:09:36 AM: [1/4] Resolving packages…
11:09:37 AM: [2/4] Fetching packages…
11:09:45 AM: [3/4] Linking dependencies…
11:09:48 AM: [4/4] Building fresh packages…
11:09:49 AM: success Saved lockfile.
11:09:49 AM: Done in 12.17s.
11:09:49 AM: npm packages installed using Yarn
11:09:49 AM: Install dependencies script success
11:09:49 AM: Starting build script
11:09:50 AM: Detected 0 framework(s)
11:09:50 AM: Section completed: initializing
11:09:52 AM: ​
11:09:52 AM: Netlify Build
11:09:52 AM: ────────────────────────────────────────────────────────────────
11:09:52 AM: ​
11:09:52 AM: ❯ Version
11:09:52 AM: @netlify/build 29.12.1
11:09:52 AM: ​
11:09:52 AM: ❯ Flags
11:09:52 AM: baseRelDir: true
11:09:52 AM: buildId: 6486e0c50b901c0008823992
11:09:52 AM: deployId: 6486e0c50b901c0008823994
11:09:52 AM: ​
11:09:52 AM: ❯ Current directory
11:09:52 AM: /opt/build/repo
11:09:52 AM: ​
11:09:52 AM: ❯ Config file
11:09:52 AM: No config file was defined: using default values.
11:09:52 AM: ​
11:09:52 AM: ❯ Context
11:09:52 AM: production
11:09:52 AM: ​
11:09:52 AM: Build command from Netlify app
11:09:52 AM: ────────────────────────────────────────────────────────────────
11:09:52 AM: ​
11:09:52 AM: $ yarn build
11:09:52 AM: yarn run v1.22.19
11:09:52 AM: warning package.json: No license field
11:09:52 AM: $ cross-env NODE_ENV=production webpack --config config/webpack.prod.js
11:09:57 AM: Missing baseline stats, see “baseline” option.
11:09:57 AM: Bundle Size — 7.84MiB (+100%).
11:09:57 AM: assets by status 8.17 MiB [cached] 14 assets
11:09:57 AM: Entrypoint main = js/runtime.95e6cc05c04d4dd14f21.js js/650.e0091b3d422a8c4d302d.js css/main.css js/main.bf7f936b04ca5d179a80.js
11:09:57 AM: chunk (runtime: runtime) css/main.css, js/main.bf7f936b04ca5d179a80.js (main) 13 KiB (javascript) 22.2 KiB (css/mini-extract) [initial] [rendered]
11:09:57 AM: chunk (runtime: runtime) js/650.e0091b3d422a8c4d302d.js (id hint: vendors) 252 KiB [initial] [rendered] split chunk (cache group: defaultVendors)
11:09:57 AM: chunk (runtime: runtime) js/runtime.95e6cc05c04d4dd14f21.js (runtime) 2.69 KiB [entry] [rendered]
11:09:57 AM: orphan modules 73.1 KiB (javascript) 7.32 KiB (runtime) [orphan] 56 modules
11:09:57 AM: runtime modules 2.69 KiB 4 modules
11:09:57 AM: modules by path ./node_modules/core-js/ 109 KiB 141 modules
11:09:57 AM: modules by path ./src/ 22.2 KiB (css/mini-extract) 13 KiB (javascript)
11:09:57 AM: css modules 22.2 KiB 8 modules
11:09:57 AM: javascript modules 13 KiB 2 modules
11:09:57 AM: modules by path ./node_modules/react/ 7.98 KiB
11:09:57 AM: modules by path ./node_modules/react/.js 404 bytes 2 modules
modules by path ./node_modules/react/cjs/
.js 7.59 KiB 2 modules
modules by path ./node_modules/react-dom/ 131 KiB
./node_modules/react-dom/client.js 619 bytes [built] [code generated]

  • 2 modules
    modules by path ./node_modules/scheduler/ 4.33 KiB
    ./node_modules/scheduler/index.js 198 bytes [built] [code generated]
    ./node_modules/scheduler/cjs/scheduler.production.min.js 4.14 KiB [built] [code generated]

ERROR in ./src/components/Main/index.js 4:0-43
Module not found: Error: Can’t resolve ‘…/Introduction’ in ‘/opt/build/repo/src/components/Main’
@ ./src/components/App/index.js 4:0-27 14:100-104
@ ./src/index.js 6:0-37 10:30-33

ERROR in ./src/components/Main/index.js 5:0-31
Module not found: Error: Can’t resolve ‘…/Skills’ in ‘/opt/build/repo/src/components/Main’
@ ./src/components/App/index.js 4:0-27 14:100-104
@ ./src/index.js 6:0-37 10:30-33

ERROR in ./src/components/Main/index.js 6:0-43
Module not found: Error: Can’t resolve ‘…/Presentation’ in ‘/opt/build/repo/src/components/Main’
@ ./src/components/App/index.js 4:0-27 14:100-104
@ ./src/index.js 6:0-37 10:30-33

ERROR in ./src/components/Main/index.js 7:0-35
Module not found: Error: Can’t resolve ‘…/Parcours’ in ‘/opt/build/repo/src/components/Main’
@ ./src/components/App/index.js 4:0-27 14:100-104
@ ./src/index.js 6:0-37 10:30-33

ERROR in ./src/components/Main/index.js 8:0-43
Module not found: Error: Can’t resolve ‘…/Realisations’ in ‘/opt/build/repo/src/components/Main’
@ ./src/components/App/index.js 4:0-27 14:100-104
@ ./src/index.js 6:0-37 10:30-33

ERROR in ./src/components/Main/index.js 9:0-33
Module not found: Error: Can’t resolve ‘…/Contact’ in ‘/opt/build/repo/src/components/Main’
@ ./src/components/App/index.js 4:0-27 14:100-104
@ ./src/index.js 6:0-37 10:30-33

6 errors have detailed information that is not shown.
Use ‘stats.errorDetails: true’ resp. ‘–stats-error-details’ to show it.

2023-06-12 09:09:57: webpack 5.85.1 compiled with 6 errors in 3997 ms (ab585e3994609e82d450)
error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:09:57 AM: info Visit yarn run | Yarn for documentation about this command.
11:09:57 AM: ​
11:09:57 AM: “build.command” failed
11:09:57 AM: ────────────────────────────────────────────────────────────────
11:09:57 AM: ​
11:09:57 AM: Error message
11:09:57 AM: Command failed with exit code 1: yarn build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:09:57 AM: ​
11:09:57 AM: Error location
11:09:57 AM: In Build command from Netlify app:
11:09:57 AM: yarn build
11:09:57 AM: ​
11:09:57 AM: Resolved config
11:09:57 AM: build:
11:09:57 AM: command: yarn build
11:09:57 AM: commandOrigin: ui
11:09:57 AM: publish: /opt/build/repo/dist
11:09:57 AM: publishOrigin: ui
11:09:57 AM: Caching artifacts
11:09:57 AM: Started saving node modules
11:09:57 AM: Finished saving node modules
11:09:57 AM: Started saving build plugins
11:09:57 AM: Finished saving build plugins
11:09:57 AM: Started saving corepack cache
11:09:57 AM: Finished saving corepack cache
11:09:57 AM: Started saving yarn cache
11:09:58 AM: Finished saving yarn cache
11:09:58 AM: Started saving pip cache
11:09:59 AM: Finished saving pip cache
11:09:59 AM: Started saving emacs cask dependencies
11:09:59 AM: Finished saving emacs cask dependencies
11:09:59 AM: Started saving maven dependencies
11:09:59 AM: Finished saving maven dependencies
11:09:59 AM: Started saving boot dependencies
11:09:59 AM: Finished saving boot dependencies
11:09:59 AM: Started saving rust rustup cache
11:09:59 AM: Finished saving rust rustup cache
11:09:59 AM: Started saving go dependencies
11:09:59 AM: Finished saving go dependencies
11:09:59 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:09:59 AM: Failing build: Failed to build site
11:09:59 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
11:10:00 AM: Finished processing build request in 30.948s


He can’t resolve some “modules”

In my local projetc with React/JS /Sass etc

I have some components in my projet :

  • App
  • Buttonup
  • Main contain { Contact / Introduction … Skills }

    SocialMedia

he cannot resolve all components in Main

in my main i have this code :


import ‘./styles.scss’;

import Introduction from ‘./Introduction’;
import Skills from ‘./Skills’;
import Presentation from ‘./Presentation’;
import Parcours from ‘./Parcours’;
import Realisations from ‘./Realisations’;
import Contact from ‘./Contact’;

function Main() {
return (
div className=“main”>
Introduction />
Skills />
Parcours />
Presentation />
Realisations />
Contact />

);
}

export default Main;


I removed the < at the beginning otherwise we did not see the code

In my local projet with yarn it works well no error but i juste want to understand why it doesn’t work when i deploy it ?

Thaks for help :slight_smile:

I clone my project and delete components inside components . Now my website works. But is it possible to deploy a wbe site with components inside components ?

ok :

  • App
  • Header
  • Footer

not ok :

  • App
  • Header
  • Main {inside components Main some components : Jobs / Skills etc }
  • Footer

Ty if you can send me documentations :slight_smile:

@FredMeziere If you can make your build run without error you will be able to deploy it.

Netlify doesn’t really know about your components, it just knows if your build succeeds or fails, so for help working with React you would need to ask your question elsewhere.