No loader is configured for ".png" files:

Currently I am experiencing an issue with deploying a Nuxt 3 app to netlify in which I am using the npm package “@vue-leaflet/vue-leaflet” as a wrapper for a leaflet map. I am aware that this is a Vue 3 package as opposed to something specifically written for Nuxt 3, however hings are running smoothly locally both in development preview and when building/previewing. However when deploying to Netlify, the build fails due what seems like import errors for *.png files in the “leaflet” package.

12:31:51 AM: Build failed with 5 errors:
12:31:51 AM: .netlify/functions-internal/server/chunks/app/server.mjs:5042:43: error: Cannot assign to “zoom” because it is a constant
12:31:51 AM: .netlify/functions-internal/server/chunks/app/server.mjs:5044:37: error: Cannot assign to “zoom” because it is a constant
12:31:51 AM: .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:87:87: error: No loader is configured for “.png” files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon-2x.png
12:31:51 AM: .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:88:87: error: No loader is configured for “.png” files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon.png
12:31:51 AM: .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:89:87: error: No loader is configured for “.png” files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-shadow.png

Since node_modules is not checked into the repo, I have included the relevant function from vue-leaflet.cjs.js here:

const resetWebpackIcon = async (Icon) => {
  const modules = await Promise.all([
    Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('leaflet/dist/images/marker-icon-2x.png')); }),
    Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('leaflet/dist/images/marker-icon.png')); }),
    Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('leaflet/dist/images/marker-shadow.png')); }),
  ]);

  delete Icon.Default.prototype._getIconUrl;

  Icon.Default.mergeOptions({
    iconRetinaUrl: modules[0].default,
    iconUrl: modules[1].default,
    shadowUrl: modules[2].default,
  });
};

Netlify site name:
https://munich-doener.netlify.app

Gitlab repo:

Build settings:
image

Full Build log here:

12:30:58 AM: Build ready to start
12:31:01 AM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
12:31:01 AM: build-image tag: v4.5.3
12:31:01 AM: buildbot version: 44e4d661fad7f5ef0b9bffed6dfdedaa2c1ad008
12:31:01 AM: Fetching cached dependencies
12:31:01 AM: Starting to download cache of 524.3MB
12:31:03 AM: Finished downloading cache in 2.668900471s
12:31:03 AM: Starting to extract cache
12:31:15 AM: Finished extracting cache in 11.686418917s
12:31:15 AM: Finished fetching cache in 14.447888188s
12:31:15 AM: Starting to prepare the repo for build
12:31:16 AM: Preparing Git Reference refs/heads/main
12:31:17 AM: Parsing package.json dependencies
12:31:18 AM: Starting build script
12:31:18 AM: Installing dependencies
12:31:18 AM: Python version set to 2.7
12:31:18 AM: Started restoring cached node version
12:31:20 AM: Finished restoring cached node version
12:31:20 AM: v16.13.2 is already installed.
12:31:21 AM: Now using node v16.13.2 (npm v8.1.2)
12:31:21 AM: Started restoring cached build plugins
12:31:21 AM: Finished restoring cached build plugins
12:31:21 AM: Attempting ruby version 2.7.2, read from environment
12:31:22 AM: Using ruby version 2.7.2
12:31:22 AM: Using PHP version 8.0
12:31:22 AM: Started restoring cached yarn cache
12:31:27 AM: Finished restoring cached yarn cache
12:31:27 AM: No yarn workspaces detected
12:31:27 AM: Started restoring cached node modules
12:31:27 AM: Finished restoring cached node modules
12:31:27 AM: Installing NPM modules using Yarn version 1.22.10
12:31:28 AM: yarn install v1.22.10
12:31:28 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.
12:31:28 AM: [1/4] Resolving packages...
12:31:28 AM: [2/4] Fetching packages...
12:31:28 AM: warning Pattern ["@nuxt/kit@npm:@nuxt/kit-edge@3.0.0-27385496.7a1cf62"] is trying to unpack in the same destination "/opt/buildhome/.yarn_cache/v6/npm-@nuxt-kit-3.0.0-27385496.7a1cf62-integrity/node_modules/@nuxt/kit" as pattern ["@nuxt/kit@npm:@nuxt/kit-edge@latest"]. This could result in non-deterministic behavior, skipping.
12:31:29 AM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
12:31:29 AM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-android-arm64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-android-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-android-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-darwin-64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-darwin-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-darwin-arm64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-darwin-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-darwin-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-freebsd-64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-freebsd-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-freebsd-arm64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-freebsd-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-freebsd-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-linux-32@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-32@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-arm@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-arm@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-mips64le@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-mips64le@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-ppc64le@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-ppc64le@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-s390x@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-s390x@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-netbsd-64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-netbsd-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-openbsd-64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-openbsd-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-sunos-64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-sunos-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-32@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-windows-32@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-32@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-windows-64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-windows-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-arm64@0.14.13: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-windows-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-android-arm64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-android-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-android-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-darwin-64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-darwin-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-darwin-arm64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-darwin-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-darwin-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-freebsd-64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-freebsd-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-freebsd-arm64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-freebsd-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-freebsd-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-linux-32@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-32@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-arm@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-arm@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-mips64le@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-mips64le@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-linux-ppc64le@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info "esbuild-linux-ppc64le@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-netbsd-64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-netbsd-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-openbsd-64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-openbsd-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-sunos-64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-sunos-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-32@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-windows-32@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-32@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: info esbuild-windows-64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-windows-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-arm64@0.13.15: The platform "linux" is incompatible with this module.
12:31:29 AM: info "esbuild-windows-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
12:31:29 AM: info esbuild-windows-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
12:31:29 AM: [3/4] Linking dependencies...
12:31:29 AM: warning " > @vue-leaflet/vue-leaflet@0.6.1" has unmet peer dependency "@types/leaflet@^1.5.7".
12:31:29 AM: warning " > @vue-leaflet/vue-leaflet@0.6.1" has unmet peer dependency "vue@^3.0.0".
12:31:29 AM: warning "@nuxt/postcss8 > css-loader@5.2.7" has unmet peer dependency "webpack@^4.27.0 || ^5.0.0".
12:31:29 AM: warning "@nuxt/postcss8 > postcss-loader@4.3.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
12:31:31 AM: [4/4] Building fresh packages...
12:31:31 AM: Done in 3.49s.
12:31:31 AM: NPM modules installed using Yarn
12:31:32 AM: Started restoring cached go cache
12:31:32 AM: Finished restoring cached go cache
12:31:32 AM: go version go1.16.5 linux/amd64
12:31:32 AM: go version go1.16.5 linux/amd64
12:31:32 AM: Installing missing commands
12:31:32 AM: Verify run directory
12:31:33 AM: ​
12:31:33 AM: ────────────────────────────────────────────────────────────────
12:31:33 AM:   Netlify Build                                                 
12:31:33 AM: ────────────────────────────────────────────────────────────────
12:31:33 AM: ​
12:31:33 AM: ❯ Version
12:31:33 AM:   @netlify/build 26.1.7
12:31:33 AM: ​
12:31:33 AM: ❯ Flags
12:31:33 AM:   baseRelDir: true
12:31:33 AM:   buildId: 61f088328da68e0008dca756
12:31:33 AM:   deployId: 61f088328da68e0008dca758
12:31:33 AM: ​
12:31:33 AM: ❯ Current directory
12:31:33 AM:   /opt/build/repo
12:31:33 AM: ​
12:31:33 AM: ❯ Config file
12:31:33 AM:   No config file was defined: using default values.
12:31:33 AM: ​
12:31:33 AM: ❯ Context
12:31:33 AM:   production
12:31:33 AM: ​
12:31:33 AM: ────────────────────────────────────────────────────────────────
12:31:33 AM:   1. Build command from Netlify app                             
12:31:33 AM: ────────────────────────────────────────────────────────────────
12:31:33 AM: ​
12:31:33 AM: $ yarn build
12:31:34 AM: yarn run v1.22.10
12:31:34 AM: $ nuxi build
12:31:34 AM: [log] Nuxt CLI v3.0.0-27385496.7a1cf62
12:31:41 AM: [info] Vite warmed up in 2820ms
12:31:43 AM: [info] Client built in 5342ms
12:31:43 AM: [info] Building server...
12:31:44 AM: [success] Server built in 959ms
12:31:44 AM: [info] Nitro preset is netlify
12:31:44 AM: [info] Cleaning up .netlify/functions-internal
12:31:44 AM: [info] Cleaning up dist
12:31:44 AM: [start] Generating public...
12:31:44 AM: [success] Generated public dist
12:31:45 AM: [start] Building server...
12:31:49 AM: [start] Writing server bundle...
12:31:49 AM: [success] Server built
12:31:50 AM:   ├─ .netlify/functions-internal/server/server.ts (216 B) (144 B gzip)
12:31:50 AM:   ├─ .netlify/functions-internal/server/chunks/nitro/lambda.mjs (71 kB) (24.3 kB gzip)
12:31:50 AM:   ├─ .netlify/functions-internal/server/chunks/index.mjs (394 kB) (90.8 kB gzip)
12:31:50 AM:   ├─ .netlify/functions-internal/server/chunks/app/vue3.mjs (284 B) (200 B gzip)
12:31:50 AM:   ├─ .netlify/functions-internal/server/chunks/app/server.mjs (198 kB) (41.9 kB gzip)
12:31:50 AM:   ├─ .netlify/functions-internal/server/chunks/app/render.mjs (22.3 kB) (6.18 kB gzip)
12:31:50 AM:   └─ .netlify/functions-internal/server/chunks/app/client.manifest.mjs (6.26 kB) (954 B gzip)
12:31:50 AM: Σ Total size: 4.08 MB (978 kB gzip)
12:31:51 AM: Done in 17.21s.
12:31:51 AM: ​
12:31:51 AM: (build.command completed in 17.4s)
12:31:51 AM: ​
12:31:51 AM: ────────────────────────────────────────────────────────────────
12:31:51 AM:   2. Functions bundling                                         
12:31:51 AM: ────────────────────────────────────────────────────────────────
12:31:51 AM: ​
12:31:51 AM: Packaging Functions from .netlify/functions-internal directory:
12:31:51 AM:  - server/server.ts
12:31:51 AM: ​
12:31:51 AM:  > .netlify/functions-internal/server/chunks/app/server.mjs:5042:43: error: Cannot assign to "zoom" because it is a constant
12:31:51 AM:     5042 │         "onUpdate:modelValue": ($event) => zoom = $event,
12:31:51 AM:          ╵                                            ~~~~
12:31:51 AM:    .netlify/functions-internal/server/chunks/app/server.mjs:5025:10: note: "zoom" was declared a constant here
12:31:51 AM:     5025 │     const zoom = 12;
12:31:51 AM:          ╵           ~~~~
12:31:51 AM:  > .netlify/functions-internal/server/chunks/app/server.mjs:5044:37: error: Cannot assign to "zoom" because it is a constant
12:31:51 AM:     5044 │         "onUpdate:zoom": ($event) => zoom = $event,
12:31:51 AM:          ╵                                      ~~~~
12:31:51 AM:    .netlify/functions-internal/server/chunks/app/server.mjs:5025:10: note: "zoom" was declared a constant here
12:31:51 AM:     5025 │     const zoom = 12;
12:31:51 AM:          ╵           ~~~~
12:31:51 AM:  > .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:89:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-shadow.png
12:31:51 AM:     89 │ ...eropNamespace(require('leaflet/dist/images/marker-shadow.png')); }),
12:31:51 AM:        ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:88:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon.png
12:31:51 AM:     88 │ ...nteropNamespace(require('leaflet/dist/images/marker-icon.png')); }),
12:31:51 AM:        ╵                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:87:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon-2x.png
12:31:51 AM:     87 │ ...ropNamespace(require('leaflet/dist/images/marker-icon-2x.png')); }),
12:31:51 AM:        ╵                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/server.ts:2:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ufo/dist/index.mjs" was marked as having no side effects
12:31:51 AM:     2 │ import 'ufo';
12:31:51 AM:       ╵        ~~~~~
12:31:51 AM:    .netlify/functions-internal/server/node_modules/ufo/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
12:31:51 AM:     7 │   "sideEffects": false,
12:31:51 AM:       ╵   ~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/server.ts:4:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/h3/dist/index.mjs" was marked as having no side effects
12:31:51 AM:     4 │ import 'h3';
12:31:51 AM:       ╵        ~~~~
12:31:51 AM:    .netlify/functions-internal/server/node_modules/h3/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
12:31:51 AM:     7 │   "sideEffects": false,
12:31:51 AM:       ╵   ~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/server.ts:5:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ohmyfetch/dist/node.mjs" was marked as having no side effects
12:31:51 AM:     5 │ import 'ohmyfetch';
12:31:51 AM:       ╵        ~~~~~~~~~~~
12:31:51 AM:    .netlify/functions-internal/server/node_modules/ohmyfetch/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
12:31:51 AM:     7 │   "sideEffects": false,
12:31:51 AM:       ╵   ~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/chunks/app/render.mjs:3:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ufo/dist/index.mjs" was marked as having no side effects
12:31:51 AM:     3 │ import 'ufo';
12:31:51 AM:       ╵        ~~~~~
12:31:51 AM:    .netlify/functions-internal/server/node_modules/ufo/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
12:31:51 AM:     7 │   "sideEffects": false,
12:31:51 AM:       ╵   ~~~~~~~~~~~~~
12:31:51 AM:  > .netlify/functions-internal/server/chunks/app/render.mjs:4:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/h3/dist/index.mjs" was marked as having no side effects
12:31:51 AM:     4 │ import 'h3';
12:31:51 AM:       ╵        ~~~~
12:31:51 AM:    .netlify/functions-internal/server/node_modules/h3/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
12:31:51 AM:     7 │   "sideEffects": false,
12:31:51 AM:       ╵   ~~~~~~~~~~~~~
12:31:51 AM: 5 of 6 warnings and all 5 errors shown (disable the message limit with --log-limit=0)
12:31:51 AM: ​
12:31:51 AM: ────────────────────────────────────────────────────────────────
12:31:51 AM:   Bundling of Function "server" failed                          
12:31:51 AM: ────────────────────────────────────────────────────────────────
12:31:51 AM: ​
12:31:51 AM:   Error message
12:31:51 AM:   Build failed with 5 errors:
12:31:51 AM:   .netlify/functions-internal/server/chunks/app/server.mjs:5042:43: error: Cannot assign to "zoom" because it is a constant
12:31:51 AM:   .netlify/functions-internal/server/chunks/app/server.mjs:5044:37: error: Cannot assign to "zoom" because it is a constant
12:31:51 AM:   .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:87:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon-2x.png
12:31:51 AM:   .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:88:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon.png
12:31:51 AM:   .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:89:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-shadow.png
12:31:51 AM: ​
12:31:51 AM:   Error location
12:31:51 AM:   While bundling Function "server"
12:31:51 AM: ​
12:31:51 AM:   Resolved config
12:31:51 AM:   build:
12:31:51 AM:     command: yarn build
12:31:51 AM:     commandOrigin: ui
12:31:51 AM:     environment:
12:31:51 AM:       - STRAPI_URL
12:31:51 AM:     publish: /opt/build/repo/dist
12:31:51 AM:     publishOrigin: ui
12:31:51 AM:   redirects:
12:31:52 AM:     - from: /*
      status: 200
      to: /.netlify/functions/server
Caching artifacts
12:31:52 AM: Started saving node modules
12:31:52 AM: Finished saving node modules
12:31:52 AM: Started saving build plugins
12:31:52 AM: Finished saving build plugins
12:31:52 AM: Started saving yarn cache
12:31:56 AM: Finished saving yarn cache
12:31:56 AM: Started saving pip cache
12:31:56 AM: Finished saving pip cache
12:31:56 AM: Started saving emacs cask dependencies
12:31:56 AM: Finished saving emacs cask dependencies
12:31:56 AM: Started saving maven dependencies
12:31:56 AM: Finished saving maven dependencies
12:31:56 AM: Started saving boot dependencies
12:31:56 AM: Finished saving boot dependencies
12:31:56 AM: Started saving rust rustup cache
12:31:56 AM: Finished saving rust rustup cache
12:31:56 AM: Started saving go dependencies
12:31:56 AM: Finished saving go dependencies
12:31:56 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:31:56 AM: Creating deploy upload records
12:31:56 AM: Failing build: Failed to build site
12:31:56 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
12:31:56 AM: Finished processing build request in 55.810656146s

Just like the error suggests, could you try changing const zoom to let zoom?

Unfortunately this is not code that I wrote, it comes from an npm package that gets pulled during build. I have uploaded the same project to vercel now and it seems to work there.

I saw it in your code here:

image

Which is why I asked. But, I think it’s not relevant anymore.

Oh that’s my bad! I have changed zoom to a reactive variable now and indeed, there are now only 3 errors in the build log. This did not seem to have impacted the errors with the .png files however :frowning:

4:01:43 PM: Build ready to start
4:01:45 PM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
4:01:45 PM: build-image tag: v4.5.3
4:01:45 PM: buildbot version: 44e4d661fad7f5ef0b9bffed6dfdedaa2c1ad008
4:01:46 PM: Fetching cached dependencies
4:01:46 PM: Starting to download cache of 524.3MB
4:01:49 PM: Finished downloading cache in 2.804765428s
4:01:49 PM: Starting to extract cache
4:02:01 PM: Finished extracting cache in 12.031109207s
4:02:01 PM: Finished fetching cache in 14.95426433s
4:02:01 PM: Starting to prepare the repo for build
4:02:02 PM: Preparing Git Reference refs/heads/main
4:02:04 PM: Parsing package.json dependencies
4:02:05 PM: Starting build script
4:02:05 PM: Installing dependencies
4:02:05 PM: Python version set to 2.7
4:02:05 PM: Started restoring cached node version
4:02:07 PM: Finished restoring cached node version
4:02:07 PM: v16.13.2 is already installed.
4:02:08 PM: Now using node v16.13.2 (npm v8.1.2)
4:02:08 PM: Started restoring cached build plugins
4:02:08 PM: Finished restoring cached build plugins
4:02:08 PM: Attempting ruby version 2.7.2, read from environment
4:02:09 PM: Using ruby version 2.7.2
4:02:10 PM: Using PHP version 8.0
4:02:10 PM: Started restoring cached yarn cache
4:02:13 PM: Finished restoring cached yarn cache
4:02:14 PM: No yarn workspaces detected
4:02:14 PM: Started restoring cached node modules
4:02:14 PM: Finished restoring cached node modules
4:02:14 PM: Installing NPM modules using Yarn version 1.22.10
4:02:15 PM: yarn install v1.22.10
4:02:15 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.
4:02:15 PM: [1/4] Resolving packages...
4:02:15 PM: [2/4] Fetching packages...
4:02:15 PM: warning Pattern ["@nuxt/kit@npm:@nuxt/kit-edge@3.0.0-27385496.7a1cf62"] is trying to unpack in the same destination "/opt/buildhome/.yarn_cache/v6/npm-@nuxt-kit-3.0.0-27385496.7a1cf62-integrity/node_modules/@nuxt/kit" as pattern ["@nuxt/kit@npm:@nuxt/kit-edge@latest"]. This could result in non-deterministic behavior, skipping.
4:02:16 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
4:02:16 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-android-arm64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-android-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-android-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-darwin-64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-darwin-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-darwin-arm64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-darwin-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-darwin-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-freebsd-64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-freebsd-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-freebsd-arm64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-freebsd-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-freebsd-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-linux-32@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-32@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-arm@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-arm@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-mips64le@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-mips64le@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-ppc64le@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-ppc64le@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-s390x@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-s390x@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-netbsd-64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-netbsd-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-openbsd-64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-openbsd-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-sunos-64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-sunos-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-32@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-windows-32@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-32@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-windows-64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-windows-64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-arm64@0.14.13: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-windows-arm64@0.14.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-arm64@0.14.13: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-android-arm64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-android-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-android-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-darwin-64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-darwin-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-darwin-arm64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-darwin-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-darwin-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-freebsd-64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-freebsd-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-freebsd-arm64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-freebsd-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-freebsd-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-linux-32@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-32@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-arm@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-arm@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-mips64le@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-mips64le@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-linux-ppc64le@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info "esbuild-linux-ppc64le@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-netbsd-64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-netbsd-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-openbsd-64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-openbsd-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-sunos-64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-sunos-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-32@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-windows-32@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-32@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: info esbuild-windows-64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-windows-64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-arm64@0.13.15: The platform "linux" is incompatible with this module.
4:02:16 PM: info "esbuild-windows-arm64@0.13.15" is an optional dependency and failed compatibility check. Excluding it from installation.
4:02:16 PM: info esbuild-windows-arm64@0.13.15: The CPU architecture "x64" is incompatible with this module.
4:02:16 PM: [3/4] Linking dependencies...
4:02:16 PM: warning " > @vue-leaflet/vue-leaflet@0.6.1" has unmet peer dependency "@types/leaflet@^1.5.7".
4:02:16 PM: warning " > @vue-leaflet/vue-leaflet@0.6.1" has unmet peer dependency "vue@^3.0.0".
4:02:16 PM: warning "@nuxt/postcss8 > css-loader@5.2.7" has unmet peer dependency "webpack@^4.27.0 || ^5.0.0".
4:02:16 PM: warning "@nuxt/postcss8 > postcss-loader@4.3.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
4:02:18 PM: [4/4] Building fresh packages...
4:02:19 PM: Done in 3.88s.
4:02:19 PM: NPM modules installed using Yarn
4:02:19 PM: Started restoring cached go cache
4:02:19 PM: Finished restoring cached go cache
4:02:19 PM: go version go1.16.5 linux/amd64
4:02:19 PM: go version go1.16.5 linux/amd64
4:02:19 PM: Installing missing commands
4:02:19 PM: Verify run directory
4:02:20 PM: ​
4:02:20 PM: ────────────────────────────────────────────────────────────────
4:02:20 PM:   Netlify Build                                                 
4:02:20 PM: ────────────────────────────────────────────────────────────────
4:02:20 PM: ​
4:02:20 PM: ❯ Version
4:02:20 PM:   @netlify/build 26.1.7
4:02:20 PM: ​
4:02:20 PM: ❯ Flags
4:02:20 PM:   baseRelDir: true
4:02:20 PM:   buildId: 61f2b3d732c1db0008c4340b
4:02:20 PM:   deployId: 61f2b3d732c1db0008c4340d
4:02:20 PM: ​
4:02:20 PM: ❯ Current directory
4:02:20 PM:   /opt/build/repo
4:02:20 PM: ​
4:02:20 PM: ❯ Config file
4:02:20 PM:   No config file was defined: using default values.
4:02:20 PM: ​
4:02:20 PM: ❯ Context
4:02:20 PM:   production
4:02:20 PM: ​
4:02:20 PM: ────────────────────────────────────────────────────────────────
4:02:20 PM:   1. Build command from Netlify app                             
4:02:20 PM: ────────────────────────────────────────────────────────────────
4:02:20 PM: ​
4:02:20 PM: $ yarn build
4:02:21 PM: yarn run v1.22.10
4:02:21 PM: $ nuxi build
4:02:21 PM: [log] Nuxt CLI v3.0.0-27385496.7a1cf62
4:02:28 PM: [info] Vite warmed up in 3260ms
4:02:31 PM: [info] Client built in 5766ms
4:02:31 PM: [info] Building server...
4:02:32 PM: [success] Server built in 1157ms
4:02:32 PM: [info] Nitro preset is netlify
4:02:32 PM: [info] Cleaning up .netlify/functions-internal
4:02:32 PM: [info] Cleaning up dist
4:02:32 PM: [start] Generating public...
4:02:32 PM: [success] Generated public dist
4:02:32 PM: [start] Building server...
4:02:38 PM: [start] Writing server bundle...
4:02:38 PM: [success] Server built
4:02:39 PM:   ├─ .netlify/functions-internal/server/server.ts (216 B) (144 B gzip)
4:02:39 PM:   ├─ .netlify/functions-internal/server/chunks/nitro/lambda.mjs (71 kB) (24.3 kB gzip)
4:02:39 PM:   ├─ .netlify/functions-internal/server/chunks/index.mjs (394 kB) (90.8 kB gzip)
4:02:39 PM:   ├─ .netlify/functions-internal/server/chunks/app/vue3.mjs (284 B) (200 B gzip)
4:02:39 PM:   ├─ .netlify/functions-internal/server/chunks/app/server.mjs (197 kB) (41.8 kB gzip)
4:02:39 PM:   ├─ .netlify/functions-internal/server/chunks/app/render.mjs (22.3 kB) (6.18 kB gzip)
4:02:39 PM:   └─ .netlify/functions-internal/server/chunks/app/client.manifest.mjs (6.09 kB) (939 B gzip)
4:02:39 PM: Σ Total size: 4.08 MB (978 kB gzip)
4:02:40 PM: Done in 18.96s.
4:02:40 PM: ​
4:02:40 PM: (build.command completed in 19.2s)
4:02:40 PM: ​
4:02:40 PM: ────────────────────────────────────────────────────────────────
4:02:40 PM:   2. Functions bundling                                         
4:02:40 PM: ────────────────────────────────────────────────────────────────
4:02:40 PM: ​
4:02:40 PM: Packaging Functions from .netlify/functions-internal directory:
4:02:40 PM:  - server/server.ts
4:02:40 PM: ​
4:02:40 PM:  > .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:87:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon-2x.png
4:02:40 PM:     87 │ ...ropNamespace(require('leaflet/dist/images/marker-icon-2x.png')); }),
4:02:40 PM:        ╵                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:88:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon.png
4:02:40 PM:     88 │ ...nteropNamespace(require('leaflet/dist/images/marker-icon.png')); }),
4:02:40 PM:        ╵                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:89:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-shadow.png
4:02:40 PM:     89 │ ...eropNamespace(require('leaflet/dist/images/marker-shadow.png')); }),
4:02:40 PM:        ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/server.ts:2:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ufo/dist/index.mjs" was marked as having no side effects
4:02:40 PM:     2 │ import 'ufo';
4:02:40 PM:       ╵        ~~~~~
4:02:40 PM:    .netlify/functions-internal/server/node_modules/ufo/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
4:02:40 PM:     7 │   "sideEffects": false,
4:02:40 PM:       ╵   ~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/server.ts:4:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/h3/dist/index.mjs" was marked as having no side effects
4:02:40 PM:     4 │ import 'h3';
4:02:40 PM:       ╵        ~~~~
4:02:40 PM:    .netlify/functions-internal/server/node_modules/h3/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
4:02:40 PM:     7 │   "sideEffects": false,
4:02:40 PM:       ╵   ~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/server.ts:5:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ohmyfetch/dist/node.mjs" was marked as having no side effects
4:02:40 PM:     5 │ import 'ohmyfetch';
4:02:40 PM:       ╵        ~~~~~~~~~~~
4:02:40 PM:    .netlify/functions-internal/server/node_modules/ohmyfetch/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
4:02:40 PM:     7 │   "sideEffects": false,
4:02:40 PM:       ╵   ~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/chunks/app/render.mjs:3:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ufo/dist/index.mjs" was marked as having no side effects
4:02:40 PM:     3 │ import 'ufo';
4:02:40 PM:       ╵        ~~~~~
4:02:40 PM:    .netlify/functions-internal/server/node_modules/ufo/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
4:02:40 PM:     7 │   "sideEffects": false,
4:02:40 PM:       ╵   ~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/chunks/app/render.mjs:4:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/h3/dist/index.mjs" was marked as having no side effects
4:02:40 PM:     4 │ import 'h3';
4:02:40 PM:       ╵        ~~~~
4:02:40 PM:    .netlify/functions-internal/server/node_modules/h3/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
4:02:40 PM:     7 │   "sideEffects": false,
4:02:40 PM:       ╵   ~~~~~~~~~~~~~
4:02:40 PM:  > .netlify/functions-internal/server/chunks/app/render.mjs:5:7: warning: Ignoring this import because ".netlify/functions-internal/server/node_modules/ohmyfetch/dist/node.mjs" was marked as having no side effects
4:02:40 PM:     5 │ import 'ohmyfetch';
4:02:40 PM:       ╵        ~~~~~~~~~~~
4:02:40 PM:    .netlify/functions-internal/server/node_modules/ohmyfetch/package.json:7:2: note: "sideEffects" is false in the enclosing "package.json" file
4:02:40 PM:     7 │   "sideEffects": false,
4:02:40 PM:       ╵   ~~~~~~~~~~~~~
4:02:40 PM: ​
4:02:40 PM: ────────────────────────────────────────────────────────────────
4:02:40 PM:   Bundling of Function "server" failed                          
4:02:40 PM: ────────────────────────────────────────────────────────────────
4:02:40 PM: ​
4:02:40 PM:   Error message
4:02:40 PM:   Build failed with 3 errors:
4:02:40 PM:   .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:87:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon-2x.png
4:02:40 PM:   .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:88:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-icon.png
4:02:40 PM:   .netlify/functions-internal/server/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js:89:87: error: No loader is configured for ".png" files: .netlify/functions-internal/server/node_modules/leaflet/dist/images/marker-shadow.png
4:02:40 PM: ​
4:02:40 PM:   Error location
4:02:40 PM:   While bundling Function "server"
4:02:40 PM: ​
4:02:40 PM:   Resolved config
4:02:40 PM:   build:
4:02:40 PM:     command: yarn build
4:02:40 PM:     commandOrigin: ui
4:02:40 PM:     environment:
4:02:40 PM:       - STRAPI_URL
4:02:40 PM:     publish: /opt/build/repo/dist
4:02:40 PM:     publishOrigin: ui
4:02:40 PM:   redirects:
4:02:41 PM:     - from: /*
      status: 200
      to: /.netlify/functions/server
Caching artifacts
4:02:41 PM: Started saving node modules
4:02:41 PM: Finished saving node modules
4:02:41 PM: Started saving build plugins
4:02:41 PM: Finished saving build plugins
4:02:41 PM: Started saving yarn cache
4:02:45 PM: Finished saving yarn cache
4:02:45 PM: Started saving pip cache
4:02:45 PM: Finished saving pip cache
4:02:45 PM: Started saving emacs cask dependencies
4:02:45 PM: Finished saving emacs cask dependencies
4:02:45 PM: Started saving maven dependencies
4:02:45 PM: Finished saving maven dependencies
4:02:45 PM: Started saving boot dependencies
4:02:45 PM: Finished saving boot dependencies
4:02:45 PM: Started saving rust rustup cache
4:02:45 PM: Finished saving rust rustup cache
4:02:45 PM: Started saving go dependencies
4:02:45 PM: Finished saving go dependencies
4:02:45 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:02:45 PM: Creating deploy upload records
4:02:45 PM: Failing build: Failed to build site
4:02:45 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:02:45 PM: Finished processing build request in 59.949378097s

I was looking more through your code and I came across this:

https://vue2-leaflet.netlify.app/quickstart/#nuxt

They suggest using a different way of using their package with Nuxt. That document also mentions some issues with the exact 3 images that you’re having issues with.

At this point, it appears to be an issue with your code or the library is incompatible. The reason it works on Vercel is because Vercel uses a different implementation of Functions than Netlify.

Check this document:

This one says for Netlify, they use the lambda present.

and for Vercel:

They use the node preset.

These are two different systems and chances are the code is compatible only with one of them.