Module not found: Error: Can't resolve './Scenes/PhaserGame.tsx' in '/opt/build/repo/src'

Hello,

I am have trouble deploying and here is what I get:

7:30:57 PM: Build ready to start
7:30:59 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
7:30:59 PM: build-image tag: v4.8.0
7:30:59 PM: buildbot version: e58b6be665675c0f99b33132a8c1eec1f775eba1
7:30:59 PM: Fetching cached dependencies
7:30:59 PM: Failed to fetch cache, continuing with build
7:30:59 PM: Starting to prepare the repo for build
7:30:59 PM: No cached dependencies found. Cloning fresh repo
7:30:59 PM: git clone GitHub - Voltair88/Pixel_Game
7:31:01 PM: Preparing Git Reference refs/heads/main
7:31:01 PM: Parsing package.json dependencies
7:31:02 PM: Starting build script
7:31:02 PM: Installing dependencies
7:31:02 PM: Python version set to 2.7
7:31:03 PM: v16.14.2 is already installed.
7:31:03 PM: Now using node v16.14.2 (npm v8.5.0)
7:31:03 PM: Started restoring cached build plugins
7:31:03 PM: Finished restoring cached build plugins
7:31:03 PM: Attempting ruby version 2.7.2, read from environment
7:31:04 PM: Using ruby version 2.7.2
7:31:04 PM: Using PHP version 8.0
7:31:05 PM: No npm workspaces detected
7:31:05 PM: Started restoring cached node modules
7:31:05 PM: Finished restoring cached node modules
7:31:05 PM: Installing NPM modules using NPM version 8.5.0
7:31:27 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
7:31:42 PM: > pixel_game@0.1.0 prepare
7:31:42 PM: > husky install
7:31:42 PM: husky - Git hooks installed
7:31:42 PM: added 1448 packages, and audited 1449 packages in 36s
7:31:42 PM: 189 packages are looking for funding
7:31:42 PM: run npm fund for details
7:31:42 PM: 8 vulnerabilities (6 moderate, 2 high)
7:31:42 PM: To address issues that do not require attention, run:
7:31:42 PM: npm audit fix
7:31:42 PM: To address all issues (including breaking changes), run:
7:31:42 PM: npm audit fix --force
7:31:42 PM: Run npm audit for details.
7:31:42 PM: NPM modules installed
7:31:42 PM: Started restoring cached go cache
7:31:42 PM: Finished restoring cached go cache
7:31:42 PM: go version go1.16.5 linux/amd64
7:31:42 PM: go version go1.16.5 linux/amd64
7:31:42 PM: Installing missing commands
7:31:42 PM: Verify run directory
7:31:44 PM: ​
7:31:44 PM: ────────────────────────────────────────────────────────────────
7:31:44 PM: Netlify Build
7:31:44 PM: ────────────────────────────────────────────────────────────────
7:31:44 PM: ​
7:31:44 PM: ❯ Version
7:31:44 PM: @netlify/build 27.0.1
7:31:44 PM: ​
7:31:44 PM: ❯ Flags
7:31:44 PM: baseRelDir: true
7:31:44 PM: buildId: 62682c51e3c2d9000a4946c1
7:31:44 PM: deployId: 62682c51e3c2d9000a4946c3
7:31:44 PM: ​
7:31:44 PM: ❯ Current directory
7:31:44 PM: /opt/build/repo
7:31:44 PM: ​
7:31:44 PM: ❯ Config file
7:31:44 PM: No config file was defined: using default values.
7:31:44 PM: ​
7:31:44 PM: ❯ Context
7:31:44 PM: production
7:31:44 PM: ​
7:31:44 PM: ────────────────────────────────────────────────────────────────
7:31:44 PM: 1. Build command from Netlify app
7:31:44 PM: ────────────────────────────────────────────────────────────────
7:31:44 PM: ​
7:31:44 PM: $ npm run build
7:31:44 PM: > pixel_game@0.1.0 build
7:31:44 PM: > react-scripts build
7:31:46 PM: Creating an optimized production build…
7:31:47 PM: Failed to compile.
7:31:47 PM:
7:31:47 PM: Module not found: Error: Can’t resolve β€˜./Scenes/PhaserGame.tsx’ in β€˜/opt/build/repo/src’
7:31:47 PM: ​
7:31:47 PM: ────────────────────────────────────────────────────────────────
7:31:47 PM: β€œbuild.command” failed
7:31:47 PM: ────────────────────────────────────────────────────────────────
7:31:47 PM: ​
7:31:47 PM: Error message
7:31:47 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:31:47 PM: ​
7:31:47 PM: Error location
7:31:47 PM: In Build command from Netlify app:
7:31:47 PM: npm run build
7:31:47 PM: ​
7:31:47 PM: Resolved config
7:31:47 PM: build:
7:31:47 PM: command: npm run build
7:31:47 PM: commandOrigin: ui
7:31:47 PM: publish: /opt/build/repo/build
7:31:47 PM: publishOrigin: ui
7:31:48 PM: Caching artifacts
7:31:48 PM: Started saving node modules
7:31:48 PM: Finished saving node modules
7:31:48 PM: Started saving build plugins
7:31:48 PM: Finished saving build plugins
7:31:48 PM: Started saving pip cache
7:31:48 PM: Finished saving pip cache
7:31:48 PM: Started saving emacs cask dependencies
7:31:48 PM: Finished saving emacs cask dependencies
7:31:48 PM: Started saving maven dependencies
7:31:48 PM: Finished saving maven dependencies
7:31:48 PM: Started saving boot dependencies
7:31:48 PM: Finished saving boot dependencies
7:31:49 PM: Creating deploy upload records
7:31:48 PM: Started saving rust rustup cache
7:31:48 PM: Finished saving rust rustup cache
7:31:48 PM: Started saving go dependencies
7:31:48 PM: Finished saving go dependencies
7:31:49 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)
7:31:49 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:31:49 PM: Failing build: Failed to build site
7:31:49 PM: Finished processing build request in 50.542464426s

Hey @Voltair88

It appears the file does not exist. There is no PhaserGame.tsx file in the src directory of the repository. There is a Phasergame.tsx file in the components directory though.

Do note too that PhaserGame.tsx and Phasergame.tsx are considered different files as Netlify Build is case sensitive.

You are correct, it was a case sensitivity issue.
Thanks!

1 Like