Home
Support Forums

Netlyfy deploy path is not resolved for SVG files - Gatsby

site link

Unable to resolve svg path in deploy but works in localhost

plugin used: gatsby-plugin-react-svg

7:12:42 PM: Build ready to start
7:12:44 PM: build-image version: 081db65c3e4ce8423fedb40e7689a87de6f84667
7:12:44 PM: build-image tag: v4.3.1
7:12:44 PM: buildbot version: 29fef7ab5dc568ca81434ff0643fc14ddc7b88ab
7:12:44 PM: Fetching cached dependencies
7:12:44 PM: Failed to fetch cache, continuing with build
7:12:44 PM: Starting to prepare the repo for build
7:12:45 PM: No cached dependencies found. Cloning fresh repo
7:12:45 PM: git clone git@gitlab.com:excrin/sedin
7:12:46 PM: Preparing Git Reference refs/heads/master
7:12:46 PM: Parsing package.json dependencies
7:12:47 PM: Starting build script
7:12:47 PM: Installing dependencies
7:12:47 PM: Python version set to 2.7
7:12:48 PM: Downloading and installing node v16.10.0...
7:12:48 PM: Downloading https://nodejs.org/dist/v16.10.0/node-v16.10.0-linux-x64.tar.xz...
7:12:48 PM: Computing checksum with sha256sum
7:12:48 PM: Checksums matched!
7:12:51 PM: Now using node v16.10.0 (npm v7.24.0)
7:12:51 PM: Started restoring cached build plugins
7:12:51 PM: Finished restoring cached build plugins
7:12:51 PM: Attempting ruby version 2.7.2, read from environment
7:12:52 PM: Using ruby version 2.7.2
7:12:52 PM: Using PHP version 8.0
7:12:52 PM: Started restoring cached node modules
7:12:52 PM: Finished restoring cached node modules
7:12:53 PM: Installing NPM modules using NPM version 7.24.0
7:12:55 PM: npm WARN old lockfile
7:12:55 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
7:12:55 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
7:12:55 PM: npm WARN old lockfile
7:12:55 PM: npm WARN old lockfile This is a one-time fix-up, please be patient...
7:12:55 PM: npm WARN old lockfile
7:13:06 PM: npm WARN EBADENGINE Unsupported engine {
7:13:06 PM: npm WARN EBADENGINE   package: 'react-lottie@1.2.3',
7:13:06 PM: npm WARN EBADENGINE   required: { npm: '^3.0.0' },
7:13:06 PM: npm WARN EBADENGINE   current: { node: 'v16.10.0', npm: '7.24.0' }
7:13:06 PM: npm WARN EBADENGINE }
7:13:17 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
7:13:17 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
7:13:18 PM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
7:13:19 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
7:13:28 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
7:13:28 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
7:13:28 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
7:13:30 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
7:13:33 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
7:13:34 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
7:13:41 PM: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
7:13:52 PM: added 1758 packages, and audited 1759 packages in 59s
7:13:52 PM: 219 packages are looking for funding
7:13:52 PM:   run `npm fund` for details
7:13:52 PM: 19 vulnerabilities (14 moderate, 5 high)
7:13:52 PM: To address issues that do not require attention, run:
7:13:52 PM:   npm audit fix
7:13:52 PM: To address all issues (including breaking changes), run:
7:13:52 PM:   npm audit fix --force
7:13:52 PM: Run `npm audit` for details.
7:13:52 PM: NPM modules installed
7:13:52 PM: Started restoring cached go cache
7:13:52 PM: Finished restoring cached go cache
7:13:53 PM: go version go1.16.5 linux/amd64
7:13:53 PM: go version go1.16.5 linux/amd64
7:13:53 PM: Installing missing commands
7:13:53 PM: Verify run directory
7:13:54 PM: ​
7:13:54 PM: ────────────────────────────────────────────────────────────────
7:13:54 PM:   Netlify Build                                                 
7:13:54 PM: ────────────────────────────────────────────────────────────────
7:13:54 PM: ​
7:13:54 PM: ❯ Version
7:13:54 PM:   @netlify/build 18.13.7
7:13:54 PM: ​
7:13:54 PM: ❯ Flags
7:13:54 PM:   baseRelDir: true
7:13:54 PM:   buildId: 615c565298f27a000767a175
7:13:54 PM:   deployId: 615c565298f27a000767a177
7:13:54 PM: ​
7:13:54 PM: ❯ Current directory
7:13:54 PM:   /opt/build/repo
7:13:54 PM: ​
7:13:54 PM: ❯ Config file
7:13:54 PM:   No config file was defined: using default values.
7:13:54 PM: ​
7:13:54 PM: ❯ Context
7:13:54 PM:   production
7:13:54 PM: ​
7:13:54 PM: ❯ Installing plugins
7:13:54 PM:    - @netlify/plugin-gatsby@1.0.3
7:13:59 PM: ​
7:13:59 PM: ❯ Loading plugins
7:13:59 PM:    - @netlify/plugin-gatsby@1.0.3 from Netlify app
7:13:59 PM: ​
7:13:59 PM: ────────────────────────────────────────────────────────────────
7:13:59 PM:   1. onPreBuild command from @netlify/plugin-gatsby             
7:13:59 PM: ────────────────────────────────────────────────────────────────
7:13:59 PM: ​
7:13:59 PM: No Gatsby cache found. Building fresh.
7:13:59 PM: Add `gatsby-plugin-netlify` to `gatsby-config.js` if you would like to support Gatsby redirects. 🎉
7:13:59 PM: ​
7:13:59 PM: (@netlify/plugin-gatsby onPreBuild completed in 227ms)
7:13:59 PM: ​
7:13:59 PM: ────────────────────────────────────────────────────────────────
7:13:59 PM:   2. Build command from Netlify app                             
7:13:59 PM: ────────────────────────────────────────────────────────────────
7:13:59 PM: ​
7:13:59 PM: $ npm run build
7:14:00 PM: > sedin@1.0.0 build
7:14:00 PM: > gatsby build
7:14:03 PM: success open and validate gatsby-configs, load plugins - 0.554s
7:14:03 PM: success onPreInit - 0.035s
7:14:03 PM: success initialize cache - 0.022s
7:14:03 PM: success copy gatsby files - 0.044s
7:14:03 PM: success Compiling Gatsby Functions - 0.319s
7:14:03 PM: success onPreBootstrap - 0.334s
7:14:03 PM: success createSchemaCustomization - 0.005s
7:14:03 PM: success Checking for changed pages - 0.000s
7:14:03 PM: success source and transform nodes - 0.153s
7:14:05 PM: success building schema - 1.521s
7:14:05 PM: success createPages - 0.000s
7:14:05 PM: success createPagesStatefully - 0.199s
7:14:05 PM: info Total nodes: 45, SitePage nodes: 9 (use --verbose for breakdown)
7:14:05 PM: success Checking for changed pages - 0.000s
7:14:05 PM: success update schema - 0.207s
7:14:05 PM: success onPreExtractQueries - 0.000s
7:14:10 PM: error (node:1673) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
7:14:10 PM: (Use `node --trace-deprecation ...` to show where the warning was created)
7:14:11 PM: success extract queries from components - 5.488s
7:14:11 PM: success write out redirect data - 0.001s
7:14:11 PM: success onPostBootstrap - 0.006s
7:14:11 PM: info bootstrap finished - 11.046s
7:14:11 PM: success run static queries - 0.008s - 1/1 124.53/s
7:14:11 PM: success run page queries - 0.004s - 9/9 2229.77/s
7:14:11 PM: success write out requires - 0.004s
7:14:38 PM: failed Building production JavaScript and CSS bundles - 26.696s
7:14:38 PM: error Generating JavaScript bundles failed
7:14:38 PM: Can't resolve '../icons/coderapper.svg' in '/opt/build/repo/src/pages'
7:14:38 PM: If you're trying to use a package make sure that '../icons/coderapper.svg' is installed. If you're trying to use a local file make sure that the path is correct.
7:14:38 PM: ​
7:14:38 PM: ────────────────────────────────────────────────────────────────
7:14:38 PM:   "build.command" failed                                        
7:14:38 PM: ────────────────────────────────────────────────────────────────
7:14:38 PM: ​
7:14:38 PM:   Error message
7:14:38 PM:   Command failed with exit code 1: npm run build
7:14:38 PM: ​
7:14:38 PM:   Error location
7:14:38 PM:   In Build command from Netlify app:
7:14:38 PM:   npm run build
7:14:38 PM: ​
7:14:38 PM:   Resolved config
7:14:38 PM:   build:
7:14:38 PM:     command: npm run build
7:14:38 PM:     commandOrigin: ui
7:14:38 PM:     publish: /opt/build/repo/public
7:14:38 PM:     publishOrigin: ui
7:14:38 PM:   plugins:
7:14:38 PM:     - inputs: {}
7:14:38 PM:       origin: ui
7:14:38 PM:       package: '@netlify/plugin-gatsby'
7:14:38 PM: Caching artifacts
7:14:38 PM: Started saving node modules
7:14:38 PM: Finished saving node modules
7:14:38 PM: Started saving build plugins
7:14:38 PM: Finished saving build plugins
7:14:38 PM: Started saving pip cache
7:14:38 PM: Finished saving pip cache
7:14:38 PM: Started saving emacs cask dependencies
7:14:38 PM: Finished saving emacs cask dependencies
7:14:38 PM: Started saving maven dependencies
7:14:38 PM: Finished saving maven dependencies
7:14:38 PM: Started saving boot dependencies
7:14:38 PM: Finished saving boot dependencies
7:14:38 PM: Started saving rust rustup cache
7:14:38 PM: Finished saving rust rustup cache
7:14:38 PM: Started saving go dependencies
7:14:38 PM: Finished saving go dependencies
7:14:40 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:14:40 PM: Creating deploy upload records
7:14:40 PM: Failing build: Failed to build site
7:14:41 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
7:14:41 PM: Finished processing build request in 1m56.649146701s

Hey there, thanks for reaching out.

What you are describing sounds a bit like a an issue with case sensitivity on our system.

Can you give this a read through and let us know if that fixes the issue?