Home
Support Forums

Svelte App can build locally, but fails do deploy with error "Could not resolve"

Netlify Site Name: lucid-roentgen-547cfe
GitHub Repo: https://github.com/seanlucano/best-fit-lines

I can build this site locally without any problems, but run into an error when deploying.

This is the first error I see in the log:
[!] Error: Could not resolve ‘./Axis.svelte’ from src/components/Chart.svelte
3:38:21 PM: Error: Could not resolve ‘./Axis.svelte’ from src/components/Chart.svelte

Axis.svelte is one of many Svelte components in the project. I’ve looked at others who have said that it is a case sensitivity issue…I’m confused about that, though. By convention, all React and Svelte developers use file names beginning with capital letters for reusable components. Is no one here using React or Svelte?

The build log:

3:38:06 PM: Build ready to start
3:38:07 PM: build-image version: 081db65c3e4ce8423fedb40e7689a87de6f84667
3:38:07 PM: build-image tag: v4.3.1
3:38:07 PM: buildbot version: a7ed393d7802bf453be684c29d76700ec4b7cbba
3:38:08 PM: Fetching cached dependencies
3:38:08 PM: Failed to fetch cache, continuing with build
3:38:08 PM: Starting to prepare the repo for build
3:38:08 PM: No cached dependencies found. Cloning fresh repo
3:38:08 PM: git clone https://github.com/seanlucano/best-fit-lines
3:38:08 PM: Preparing Git Reference refs/heads/main
3:38:09 PM: Parsing package.json dependencies
3:38:09 PM: Starting build script
3:38:09 PM: Installing dependencies
3:38:09 PM: Python version set to 2.7
3:38:10 PM: v16.9.1 is already installed.
3:38:10 PM: Now using node v16.9.1 (npm v7.21.1)
3:38:10 PM: Started restoring cached build plugins
3:38:10 PM: Finished restoring cached build plugins
3:38:10 PM: Attempting ruby version 2.7.2, read from environment
3:38:12 PM: Using ruby version 2.7.2
3:38:12 PM: Using PHP version 8.0
3:38:12 PM: Started restoring cached node modules
3:38:12 PM: Finished restoring cached node modules
3:38:12 PM: Installing NPM modules using NPM version 7.21.1
3:38:13 PM: npm WARN old lockfile
3:38:13 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
3:38:13 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
3:38:13 PM: npm WARN old lockfile
3:38:13 PM: npm WARN old lockfile This is a one-time fix-up, please be patient…
3:38:13 PM: npm WARN old lockfile
3:38:18 PM: added 135 packages, and audited 136 packages in 5s
3:38:18 PM: 6 packages are looking for funding
3:38:18 PM: run npm fund for details
3:38:18 PM: found 0 vulnerabilities
3:38:18 PM: NPM modules installed
3:38:18 PM: Started restoring cached go cache
3:38:18 PM: Finished restoring cached go cache
3:38:18 PM: go version go1.16.5 linux/amd64
3:38:18 PM: go version go1.16.5 linux/amd64
3:38:18 PM: Installing missing commands
3:38:18 PM: Verify run directory
3:38:19 PM: ​
3:38:19 PM: ────────────────────────────────────────────────────────────────
3:38:19 PM: Netlify Build
3:38:19 PM: ────────────────────────────────────────────────────────────────
3:38:19 PM: ​
3:38:19 PM: ❯ Version
3:38:19 PM: @netlify/build 18.10.0
3:38:19 PM: ​
3:38:19 PM: ❯ Flags
3:38:19 PM: baseRelDir: true
3:38:19 PM: buildId: 61466a4ecb908d1b091d1185
3:38:19 PM: deployId: 61466a4ecb908d1b091d1187
3:38:19 PM: ​
3:38:19 PM: ❯ Current directory
3:38:19 PM: /opt/build/repo
3:38:19 PM: ​
3:38:19 PM: ❯ Config file
3:38:19 PM: No config file was defined: using default values.
3:38:19 PM: ​
3:38:19 PM: ❯ Context
3:38:19 PM: production
3:38:19 PM: ​
3:38:19 PM: ────────────────────────────────────────────────────────────────
3:38:19 PM: 1. Build command from Netlify app
3:38:19 PM: ────────────────────────────────────────────────────────────────
3:38:19 PM: ​
3:38:19 PM: $ npm run build
3:38:20 PM: > svelte-app@1.0.0 build
3:38:20 PM: > rollup -c
3:38:20 PM:
3:38:20 PM: src/main.js → public/build/bundle.js…
3:38:21 PM: (!) Plugin svelte: ‘Circle’ is not defined
3:38:21 PM: src/components/Chart.svelte
3:38:21 PM: 164:
3:38:21 PM: 165: {#each points[$member] as {x, y}, i}
3:38:21 PM: 166: <Circle
3:38:21 PM: ^
3:38:21 PM: 167: cx={xScale(x)}
3:38:21 PM: 168: cy={yScale(y)}
3:38:21 PM: (!) Plugin svelte: Chart has unused export property ‘focusPoints’. If it is for external reference only, please consider using export const focusPoints
3:38:21 PM: src/components/Chart.svelte
3:38:21 PM: 24: export let showUserLine = false;
3:38:21 PM: 25: export let showRegressionLine = false;
3:38:21 PM: 26: export let focusPoints = false;
3:38:21 PM: ^
3:38:21 PM: 27:
3:38:21 PM: 28: export let showUserLineControls = false;
3:38:21 PM: (!) Plugin svelte: Chart has unused export property ‘showUserResidualLengths’. If it is for external reference only, please consider using export const showUserResidualLengths
3:38:21 PM: src/components/Chart.svelte
3:38:21 PM: 31: export let showRegressionResiduals = true;
3:38:21 PM: 32: export let showUserResiduals = true;
3:38:21 PM: 33: export let showUserResidualLengths = false;
3:38:21 PM: ^
3:38:21 PM: 34: export let showRegressionResidualLengths = false;
3:38:21 PM: 35:
3:38:21 PM: (!) Plugin svelte: Chart has unused export property ‘showRegressionResidualLengths’. If it is for external reference only, please consider using export const showRegressionResidualLengths
3:38:21 PM: src/components/Chart.svelte
3:38:21 PM: 32: export let showUserResiduals = true;
3:38:21 PM: 33: export let showUserResidualLengths = false;
3:38:21 PM: 34: export let showRegressionResidualLengths = false;
3:38:21 PM: ^
3:38:21 PM: 35:
3:38:21 PM: 36: //userNavLogic
3:38:21 PM: (!) Plugin svelte: UserLine has unused export property ‘svg’. If it is for external reference only, please consider using export const svg
3:38:21 PM: src/components/UserLine.svelte
3:38:21 PM: 5: export let xScale;
3:38:21 PM: 6: export let yScale;
3:38:21 PM: 7: export let svg;
3:38:21 PM: ^
3:38:21 PM: 8:
3:38:21 PM: 9:
3:38:21 PM: (!) Plugin svelte: Button has unused export property ‘type’. If it is for external reference only, please consider using export const type
3:38:21 PM: src/shared/Button.svelte
3:38:21 PM: 3: export let flat = false;
3:38:21 PM: 4: export let disabled = false;
3:38:21 PM: 5: export let type;
3:38:21 PM: ^
3:38:21 PM: 6:
3:38:21 PM: 7:
3:38:21 PM: [!] Error: Could not resolve ‘./Axis.svelte’ from src/components/Chart.svelte
3:38:21 PM: Error: Could not resolve ‘./Axis.svelte’ from src/components/Chart.svelte
3:38:21 PM: at error (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:151:30)
3:38:21 PM: at ModuleLoader.handleResolveId (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:19862:24)
3:38:21 PM: at /opt/build/repo/node_modules/rollup/dist/shared/rollup.js:19856:26
3:38:21 PM: ​
3:38:21 PM: ────────────────────────────────────────────────────────────────
3:38:21 PM: “build.command” failed
3:38:21 PM: ────────────────────────────────────────────────────────────────
3:38:21 PM: ​
3:38:21 PM: Error message
3:38:21 PM: Command failed with exit code 1: npm run build
3:38:21 PM: ​
3:38:21 PM: Error location
3:38:21 PM: In Build command from Netlify app:
3:38:21 PM: npm run build
3:38:21 PM: ​
3:38:21 PM: Resolved config
3:38:21 PM: build:
3:38:21 PM: command: npm run build
3:38:21 PM: commandOrigin: ui
3:38:21 PM: publish: /opt/build/repo/public
3:38:21 PM: publishOrigin: ui
3:38:21 PM: Caching artifacts
3:38:21 PM: Started saving node modules
3:38:21 PM: Finished saving node modules
3:38:21 PM: Started saving build plugins
3:38:21 PM: Finished saving build plugins
3:38:21 PM: Started saving pip cache
3:38:21 PM: Finished saving pip cache
3:38:21 PM: Started saving emacs cask dependencies
3:38:21 PM: Finished saving emacs cask dependencies
3:38:21 PM: Started saving maven dependencies
3:38:21 PM: Finished saving maven dependencies
3:38:21 PM: Started saving boot dependencies
3:38:21 PM: Finished saving boot dependencies
3:38:21 PM: Started saving rust rustup cache
3:38:21 PM: Finished saving rust rustup cache
3:38:21 PM: Started saving go dependencies
3:38:21 PM: Finished saving go dependencies
3:38:23 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:38:23 PM: Creating deploy upload records
3:38:23 PM: Failing build: Failed to build site
3:38:23 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
3:38:23 PM: Finished processing build request in 15.702564401s

Hi @seanlucano

The issue here is one of case-sensitive filenames. The Axis.svelte file in your GitHub repository is actually Axis.Svelte. This is also the case with a few other extensions.

True. But file extensions are lowercase.

OOOhhhhhhhhhh. Face palm. Thank you!