Netlify base setting not working as expected

My site: https://signwriter.netlify.app/
My mono repo structure:

My netlifytoml:

[build]
  base="./code/SignWriter"
  command="npm run build"
  publish="build"
  • npm run build within the /code/SignWriter dir works fine.
  • netlify build within the /code/SignWriter dir works fine.

Problem
netlify build at the root throws errors, although it should behave the same because of the base being set to code/SignWriter.
This also leads to a build error when trying to build on netlify servers.

Error when building from /:

Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 29.56.0

❯ Flags
  accountId: 601535e611dd6b1cd23557d7
  dry: false
  offline: false

❯ Current directory
  /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter

❯ Config file
  /Users/velius/Documents/dev/15-gl2-kessler-schmidt/netlify.toml

❯ Context
  production

build.command from netlify.toml                               
────────────────────────────────────────────────────────────────

$ npm run build

> signwriter@0.0.1 build
> vite build

vite v5.4.11 building SSR bundle for production...
12:00:53 PM [vite-plugin-svelte] src/routes/+layout.svelte:63:32 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
61:   setInitialClassState();
62: 
63:   $: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''
                                                                ^
64: </script>
65: 
✓ 59 modules transformed.
(node:82998) ExperimentalWarning: CommonJS module /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/lib/load-config.js is loading ES Module /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/tailwind.config.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
transforming (214) node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js
PWA v0.21.0
mode      generateSW
precache  2 entries (0.00 KiB)
files generated
  .svelte-kit/output/server/sw.js
  .svelte-kit/output/server/workbox-e3490c72.js
warnings
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/.svelte-kit/output",
  "globPattern": "**/*.{js,css,html,svg,png,ico,tff}",
  "globIgnores": [
    "server/**",
    "server/sw.js",
    "server/workbox-*.js"
  ]
}
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/.svelte-kit/output",
  "globPattern": "prerendered/**/*.html",
  "globIgnores": [
    "server/**",
    "server/sw.js",
    "server/workbox-*.js"
  ]
}
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/.svelte-kit/output",
  "globPattern": "client/**/*.{js,css,ico,png,svg,webp,webmanifest}",
  "globIgnores": [
    "server/**",
    "server/sw.js",
    "server/workbox-*.js"
  ]
}

x Build failed in 1.75s
error during build:
[vite:css] [postcss] Cannot read properties of undefined (reading 'call')
file: /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/src/app.css:undefined:NaN
    at /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/tailwind.config.js:24:24
    at evalModule (/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/jiti/dist/jiti.js:1:247313)
    at jiti (/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/jiti/dist/jiti.js:1:245241)
    at /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/lib/load-config.js:56:30
    at loadConfig (/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/lib/load-config.js:58:6)
    at getTailwindConfig (/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:71:116)
    at /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:100:92
    at /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11
    at plugins (/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/tailwindcss/lib/plugin.js:38:69)
    at LazyResult.runOnRoot (/Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/node_modules/postcss/lib/lazy-result.js:329:16)

"build.command" failed                                        
────────────────────────────────────────────────────────────────

  Error message
  Command failed with exit code 1: npm run build

  Error location
  In build.command from netlify.toml:
  npm run build

  Resolved config
  build:
    base: /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter
    command: npm run build
    commandOrigin: config
    publish: /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/build
    publishOrigin: config
  functionsDirectory: /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter/netlify/functions

Successful build when running from /code/Signwriter:

⋊> ~/D/d/15-gl2-kessler-schmidt on c786f7f  cd code/SignWriter/                                            12:00:55
Now using Node v22.11.0 (npm 10.9.0) ~/.local/share/nvm/v22.11.0/bin/node
⋊> ~/D/d/1/c/SignWriter on c786f7f  netlify build                                                          12:03:26

Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 29.56.1

❯ Flags
  accountId: 601535e611dd6b1cd23557d7
  dry: false
  offline: false

❯ Current directory
  /Users/velius/Documents/dev/15-gl2-kessler-schmidt/code/SignWriter

❯ Config file
  /Users/velius/Documents/dev/15-gl2-kessler-schmidt/netlify.toml

❯ Context
  production

build.command from netlify.toml                               
────────────────────────────────────────────────────────────────

$ npm run build

> signwriter@0.0.1 build
> vite build

vite v5.4.11 building SSR bundle for production...
transforming (1) node_modules/@sveltejs/kit/src/runtime/server/index.js12:03:37 PM [vite-plugin-svelte] src/routes/+layout.svelte:63:32 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
61:   setInitialClassState();
62: 
63:   $: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''
                                                                ^
64: </script>
65: 
"SupabaseClient" is imported from external module "@supabase/supabase-js" but never used in "src/lib/components/cardItem.svelte" and "src/lib/supabaseUtils.ts".
✓ 254 modules transformed.
(node:83237) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
vite v5.4.11 building for production...
transforming (1) .svelte-kit/generated/client-optimized/nodes/0.js12:03:39 PM [vite-plugin-svelte] src/routes/+layout.svelte:63:32 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
61:   setInitialClassState();
62: 
63:   $: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''
                                                                ^
64: </script>
65: 
✓ 346 modules transformed.
.svelte-kit/output/client/_app/version.json                                                                0.03 kB │ gzip:     0.05 kB
.svelte-kit/output/client/registerSW.js                                                                    0.14 kB
.svelte-kit/output/client/manifest.webmanifest                                                             0.23 kB
.svelte-kit/output/client/.vite/manifest.json                                                             16.64 kB │ gzip:     1.92 kB
.svelte-kit/output/client/_app/immutable/assets/ProgressBar.c6i8ireL.css                                   0.28 kB │ gzip:     0.16 kB
.svelte-kit/output/client/_app/immutable/assets/0.ots5YvHz.css                                           127.34 kB │ gzip:    17.52 kB
.svelte-kit/output/client/_app/immutable/chunks/legacy.CtaTdtmd.js                                         0.04 kB │ gzip:     0.06 kB
.svelte-kit/output/client/_app/immutable/chunks/index.BFqC5wTN.js                                          0.05 kB │ gzip:     0.07 kB
.svelte-kit/output/client/_app/immutable/entry/start.3OvpZIvb.js                                           0.07 kB │ gzip:     0.08 kB
.svelte-kit/output/client/_app/immutable/chunks/disclose-version.Bg9kRutz.js                               0.09 kB │ gzip:     0.09 kB
.svelte-kit/output/client/_app/immutable/nodes/6.BkRNxWVr.js                                               0.12 kB │ gzip:     0.12 kB
.svelte-kit/output/client/_app/immutable/nodes/12.BkRNxWVr.js                                              0.12 kB │ gzip:     0.12 kB
.svelte-kit/output/client/_app/immutable/chunks/misc.DDK2uyiO.js                                           0.18 kB │ gzip:     0.17 kB
.svelte-kit/output/client/_app/immutable/chunks/utils.B_Q8R824.js                                          0.19 kB │ gzip:     0.17 kB
.svelte-kit/output/client/_app/immutable/chunks/stores.CifvDHj0.js                                         0.29 kB │ gzip:     0.18 kB
.svelte-kit/output/client/_app/immutable/chunks/input.BS3GzRcw.js                                          0.30 kB │ gzip:     0.21 kB
.svelte-kit/output/client/_app/immutable/chunks/actions.LSM62X63.js                                        0.30 kB │ gzip:     0.24 kB
.svelte-kit/output/client/_app/immutable/chunks/browser.BaUz-1h7.js                                        0.31 kB │ gzip:     0.25 kB
.svelte-kit/output/client/_app/immutable/chunks/this.CMljLUwk.js                                           0.33 kB │ gzip:     0.24 kB
.svelte-kit/output/client/_app/immutable/chunks/if.CVYtOkhb.js                                             0.42 kB │ gzip:     0.31 kB
.svelte-kit/output/client/_app/immutable/chunks/class.CPj45Nlb.js                                          0.48 kB │ gzip:     0.23 kB
.svelte-kit/output/client/_app/immutable/chunks/lifecycle.DtVJorDm.js                                      0.54 kB │ gzip:     0.35 kB
.svelte-kit/output/client/_app/immutable/chunks/html.39sw9nTU.js                                           0.57 kB │ gzip:     0.40 kB
.svelte-kit/output/client/_app/immutable/chunks/store.KiU9jeEe.js                                          0.60 kB │ gzip:     0.36 kB
.svelte-kit/output/client/_app/immutable/chunks/_commonjsHelpers.BosuxZz1.js                               0.69 kB │ gzip:     0.38 kB
.svelte-kit/output/client/_app/immutable/nodes/1.DuxPEUA0.js                                               0.71 kB │ gzip:     0.42 kB
.svelte-kit/output/client/_app/immutable/nodes/4.RuO0AtNq.js                                               1.09 kB │ gzip:     0.63 kB
.svelte-kit/output/client/_app/immutable/chunks/utils.DJ0zP7jS.js                                          1.09 kB │ gzip:     0.61 kB
.svelte-kit/output/client/_app/immutable/chunks/preload-helper.C1FmrZbK.js                                 1.14 kB │ gzip:     0.68 kB
.svelte-kit/output/client/_app/immutable/nodes/5.B_DeUELi.js                                               1.22 kB │ gzip:     0.68 kB
.svelte-kit/output/client/_app/immutable/chunks/ProgressBar.svelte_svelte_type_style_lang.OK0SGqZa.js      1.39 kB │ gzip:     0.67 kB
.svelte-kit/output/client/_app/immutable/nodes/8.DXSgWRzq.js                                               1.45 kB │ gzip:     0.82 kB
.svelte-kit/output/client/_app/immutable/chunks/render.CbwXIk-o.js                                         1.67 kB │ gzip:     0.96 kB
.svelte-kit/output/client/_app/immutable/chunks/Icon.JjnP8Wp7.js                                           1.73 kB │ gzip:     0.94 kB
.svelte-kit/output/client/_app/immutable/chunks/forms.DXL8ZZle.js                                          1.96 kB │ gzip:     0.94 kB
.svelte-kit/output/client/_app/immutable/chunks/props.BZ_1G8MU.js                                          1.98 kB │ gzip:     1.01 kB
.svelte-kit/output/client/_app/immutable/chunks/proxy.DOrp7pIm.js                                          2.10 kB │ gzip:     0.98 kB
.svelte-kit/output/client/_app/immutable/chunks/attributes.B5LQTcST.js                                     2.20 kB │ gzip:     1.12 kB
.svelte-kit/output/client/_app/immutable/nodes/7.Dhi17Jjs.js                                               2.31 kB │ gzip:     1.23 kB
.svelte-kit/output/client/_app/immutable/nodes/2.B-bt7u_7.js                                               2.31 kB │ gzip:     1.20 kB
.svelte-kit/output/client/_app/immutable/chunks/template.DHBgj9iB.js                                       3.16 kB │ gzip:     1.56 kB
.svelte-kit/output/client/_app/immutable/chunks/each.BSYkRwWU.js                                           3.19 kB │ gzip:     1.62 kB
.svelte-kit/output/client/_app/immutable/nodes/3.Brt72y7P.js                                               3.54 kB │ gzip:     1.52 kB
.svelte-kit/output/client/_app/immutable/nodes/9.DTpAlfS1.js                                               4.00 kB │ gzip:     1.84 kB
.svelte-kit/output/client/_app/immutable/nodes/10.CqiVg1p9.js                                              4.59 kB │ gzip:     2.31 kB
.svelte-kit/output/client/_app/immutable/chunks/index.CUIl3UGF.js                                          4.77 kB │ gzip:     2.22 kB
.svelte-kit/output/client/_app/immutable/nodes/11.DT55JB4e.js                                              5.99 kB │ gzip:     2.81 kB
.svelte-kit/output/client/_app/immutable/entry/app.CckpcZGm.js                                             7.31 kB │ gzip:     2.96 kB
.svelte-kit/output/client/_app/immutable/chunks/index-client.CjRRMbof.js                                  13.52 kB │ gzip:     5.54 kB
.svelte-kit/output/client/_app/immutable/chunks/functions.7WSLLGk3.js                                     19.36 kB │ gzip:     7.50 kB
.svelte-kit/output/client/_app/immutable/chunks/Ripple.DKMXekvJ.js                                        22.05 kB │ gzip:     5.39 kB
.svelte-kit/output/client/_app/immutable/chunks/entry.B8Bk3H5t.js                                         29.98 kB │ gzip:    11.78 kB
.svelte-kit/output/client/_app/immutable/chunks/supabaseUtils.D0hIs1KV.js                                 63.09 kB │ gzip:    21.33 kB
.svelte-kit/output/client/_app/immutable/nodes/0.B-k_p55a.js                                             130.76 kB │ gzip:    37.83 kB
.svelte-kit/output/client/_app/immutable/chunks/drawView.DIJp2C5W.js                                   4,758.93 kB │ gzip: 1,437.51 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 12.46s
(node:83237) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
.svelte-kit/output/server/.vite/manifest.json                                         7.91 kB
.svelte-kit/output/server/_app/immutable/assets/ProgressBar.c6i8ireL.css              0.28 kB
.svelte-kit/output/server/_app/immutable/assets/_layout.CN2naQyb.css                127.27 kB
.svelte-kit/output/server/entries/pages/_page.ts.js                                   0.05 kB
.svelte-kit/output/server/entries/pages/home/_page.svelte.js                          0.06 kB
.svelte-kit/output/server/entries/pages/stats/_page.svelte.js                         0.06 kB
.svelte-kit/output/server/chunks/html.js                                              0.14 kB
.svelte-kit/output/server/entries/pages/_layout.server.ts.js                          0.22 kB
.svelte-kit/output/server/internal.js                                                 0.31 kB
.svelte-kit/output/server/chunks/equality.js                                          0.33 kB
.svelte-kit/output/server/chunks/client.js                                            0.38 kB
.svelte-kit/output/server/chunks/public.js                                            0.39 kB
.svelte-kit/output/server/entries/fallbacks/error.svelte.js                           0.52 kB
.svelte-kit/output/server/chunks/stores.js                                            0.69 kB
.svelte-kit/output/server/entries/pages/_layout.ts.js                                 0.78 kB
.svelte-kit/output/server/entries/pages/draw/_page.svelte.js                          0.83 kB
.svelte-kit/output/server/entries/pages/draw/_id_/_page.svelte.js                     1.08 kB
.svelte-kit/output/server/chunks/ProgressBar.svelte_svelte_type_style_lang.js         1.38 kB
.svelte-kit/output/server/entries/pages/settings/account/_page.server.ts.js           1.55 kB
.svelte-kit/output/server/chunks/index3.js                                            1.58 kB
.svelte-kit/output/server/entries/pages/modules/_id_/lectures/_page.svelte.js         1.66 kB
.svelte-kit/output/server/entries/pages/_page.svelte.js                               1.74 kB
.svelte-kit/output/server/chunks/Icon.js                                              1.76 kB
.svelte-kit/output/server/entries/pages/auth/_page.server.ts.js                       1.78 kB
.svelte-kit/output/server/chunks/supabaseUtils.js                                     2.18 kB
.svelte-kit/output/server/entries/pages/modules/_page.svelte.js                       2.23 kB
.svelte-kit/output/server/entries/pages/auth/_page.svelte.js                          2.30 kB
.svelte-kit/output/server/chunks/index2.js                                            2.34 kB
.svelte-kit/output/server/chunks/hooks.server.js                                      3.21 kB
.svelte-kit/output/server/entries/pages/modules/_id_/lectures/_id_/_page.svelte.js    4.45 kB
.svelte-kit/output/server/entries/pages/settings/_page.svelte.js                      4.68 kB
.svelte-kit/output/server/chunks/drawView.js                                          5.61 kB
.svelte-kit/output/server/chunks/exports.js                                           6.09 kB
.svelte-kit/output/server/entries/pages/settings/account/_page.svelte.js              6.65 kB
.svelte-kit/output/server/chunks/internal.js                                         18.15 kB
.svelte-kit/output/server/entries/pages/_layout.svelte.js                            19.45 kB
.svelte-kit/output/server/chunks/index.js                                            29.77 kB
.svelte-kit/output/server/chunks/functions.js                                        31.34 kB
.svelte-kit/output/server/index.js                                                   91.64 kB
✓ built in 14.61s

PWA v0.21.0
mode      generateSW
precache  63 entries (6591.94 KiB)
files generated
  .svelte-kit/output/server/sw.js
  .svelte-kit/output/server/workbox-e3490c72.js

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-auto
  Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing
  ✔ done

(build.command completed in 16.9s)

Functions bundling                                            
────────────────────────────────────────────────────────────────

The Netlify Functions setting targets a non-existing directory: netlify/functions

(Functions bundling completed in 1ms)

Netlify Build Complete                                        
────────────────────────────────────────────────────────────────

(Netlify Build completed in 17.8s)

The current directory seems to be the same in both cases, so I’m not sure what’s different here. Do you have a reproduction repo to share?

I found that I had installed netlify-cli using npm on node-23. uninstalling it and using it over node-22, the requirement of the project. Fixes the build error. But how am I supposed to fix that build error on the netlify servers?

Turns out, the project needs not just node 22, but node 22.11 and Netlify was using 22.12. I forced the specific version in the .nvrc to 22.11 and it worked.

thanks for writing back and confirming the issue is resolved.