T
TanStack6d ago
inland-turquoise

Building for netlify not working on RC

Hi, With the upgrades for to RC I am getting this error when trying to run netlify deploy.
The Netlify Functions setting targets a non-existing directory: .netlify/functions-internal
Packaging Functions generated by your framework:
- server.mjs
The Netlify Functions setting targets a non-existing directory: .netlify/functions-internal
Packaging Functions generated by your framework:
- server.mjs
I have this netlify.toml which has been working OK.
[build]
command = "npm run
[build]
command = "npm run
And these dependencies in package.json
"@netlify/blobs": "^10.0.11",
"@netlify/functions": "4.2.3",
"@netlify/neon": "^0.1.0",
"@tanstack/query-db-collection": "^0.2.22",
"@tanstack/react-db": "^0.1.23",
"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-form": "^1.23.4",
"@tanstack/react-query": "^5.90.2",
"@tanstack/react-query-devtools": "^5.90.2",
"@tanstack/react-router": "^1.132.17",
"@tanstack/react-router-devtools": "^1.132.17",
"@tanstack/react-start": "^1.132.18",
"@netlify/vite-plugin-tanstack-start": "^1.0.1",
"@tanstack/devtools-vite": "^0.3.3",
"@tanstack/eslint-plugin-router": "^1.132.0",
"@tanstack/router-plugin": "^1.132.17",
"drizzle-orm": "^0.44.5",
"drizzle-kit": "^0.31.4",
"@netlify/blobs": "^10.0.11",
"@netlify/functions": "4.2.3",
"@netlify/neon": "^0.1.0",
"@tanstack/query-db-collection": "^0.2.22",
"@tanstack/react-db": "^0.1.23",
"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-form": "^1.23.4",
"@tanstack/react-query": "^5.90.2",
"@tanstack/react-query-devtools": "^5.90.2",
"@tanstack/react-router": "^1.132.17",
"@tanstack/react-router-devtools": "^1.132.17",
"@tanstack/react-start": "^1.132.18",
"@netlify/vite-plugin-tanstack-start": "^1.0.1",
"@tanstack/devtools-vite": "^0.3.3",
"@tanstack/eslint-plugin-router": "^1.132.0",
"@tanstack/router-plugin": "^1.132.17",
"drizzle-orm": "^0.44.5",
"drizzle-kit": "^0.31.4",
Node.js v22.20.0 arm64 ( node -p process.arch process.platform) Attached is the vite.config.json and the netlify.toml. There is no .netlify/functions-internal directory being created when I run vite build so have I missed something with the configuration here? As I said, this was working with start 1.31.x This application has a number of server functions and server only routes. Any ideas or hints to fix this would be much appreciated. Many thanks in advance
4 Replies
metropolitan-bronze
metropolitan-bronze6d ago
there is a netlify vite plugin for hosting RC now
metropolitan-bronze
metropolitan-bronze6d ago
Hosting | TanStack Start React Docs
Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the...
inland-turquoise
inland-turquoiseOP3d ago
Thanks @APPLE I think I am already using that. It's the last line of the imports. Or am I still missing something? there is a .netlify/v1/functions/server.mjs file being created if I run vite build I change the build section of the netlify.toml to this:
[build]
command = "npm run build"
publish = "dist/client"
functions = ".netlify/v1/functions"
[build]
command = "npm run build"
publish = "dist/client"
functions = ".netlify/v1/functions"
The error is now:
Functions bundling
────────────────────────────────────────────────────────────────

Packaging Functions generated by your framework:
- server.mjs

Packaging Functions from .netlify/v1/functions directory:
- server.mjs


Bundling of function "server" failed
────────────────────────────────────────────────────────────────

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

Packaging Functions generated by your framework:
- server.mjs

Packaging Functions from .netlify/v1/functions directory:
- server.mjs


Bundling of function "server" failed
────────────────────────────────────────────────────────────────

Error message

You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.

Specifically the "@esbuild/darwin-x64" package is present but this platform
needs the "@esbuild/darwin-arm64" package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
​​​
Error location
While bundling function "server"

Resolved config
build:
command: npm run build
commandOrigin: config
environment:
- TRAILING_SLASH
publish: /Users/jordan/Documents/workspace/momnium-toolkit/dist/client
publishOrigin: config
functionsDirectory: /Users/jordan/Documents/workspace/momnium-toolkit/.netlify/v1/functions
headers:
- for: /assets/*
values:
Cache-Control: public, max-age=31536000, immutable
- for: /*.png
values:
Cache-Control: public, max-age=86400
- for: /*.ico
values:
Cache-Control: public, max-age=86400
- for: /*
values:
Cache-Control: no-cache, no-store, must-revalidate
headersOrigin: config
redirects:
- from: /sitemap.xml
status: 200
to: /sitemap.xml
redirectsOrigin: config

exit code 2
Error message

You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.

Specifically the "@esbuild/darwin-x64" package is present but this platform
needs the "@esbuild/darwin-arm64" package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
​​​
Error location
While bundling function "server"

Resolved config
build:
command: npm run build
commandOrigin: config
environment:
- TRAILING_SLASH
publish: /Users/jordan/Documents/workspace/momnium-toolkit/dist/client
publishOrigin: config
functionsDirectory: /Users/jordan/Documents/workspace/momnium-toolkit/.netlify/v1/functions
headers:
- for: /assets/*
values:
Cache-Control: public, max-age=31536000, immutable
- for: /*.png
values:
Cache-Control: public, max-age=86400
- for: /*.ico
values:
Cache-Control: public, max-age=86400
- for: /*
values:
Cache-Control: no-cache, no-store, must-revalidate
headersOrigin: config
redirects:
- from: /sitemap.xml
status: 200
to: /sitemap.xml
redirectsOrigin: config

exit code 2
I this the esbuild error might be because of the "While bundling function "server" error but now 100% sure. (The node_modules/esbuild directory only has the arm64 version of the package. ) Still struggling with this. I have run npm using arch -arm64 npm install and the output of npm ls --all | grep '@esbuild/' shows there is no x86 esbuild installed. (showing unmet peer dependency for all the other architectures other than arm64). So it appears I have the correct version installed. Current dependencies:
"@tanstack/react-router": "^1.132.25",
"@tanstack/react-router-devtools": "^1.132.25",
"@tanstack/react-start": "^1.132.25",
"@netlify/vite-plugin-tanstack-start": "^1.0.1",
"@tanstack/router-plugin": "^1.132.25",
"@tanstack/react-router": "^1.132.25",
"@tanstack/react-router-devtools": "^1.132.25",
"@tanstack/react-start": "^1.132.25",
"@netlify/vite-plugin-tanstack-start": "^1.0.1",
"@tanstack/router-plugin": "^1.132.25",
npm ls returns this for esbuild:
├─┬ esbuild@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/aix-ppc64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/android-arm@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/android-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/android-x64@0.25.10
│ ├── @esbuild/darwin-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/darwin-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/freebsd-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/freebsd-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-arm@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-ia32@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-loong64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-mips64el@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-ppc64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-riscv64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-s390x@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/netbsd-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/netbsd-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/openbsd-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/openbsd-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/openharmony-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/sunos-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/win32-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/win32-ia32@0.25.10
│ └── UNMET OPTIONAL DEPENDENCY @esbuild/win32-x64@0.25.10
├─┬ esbuild@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/aix-ppc64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/android-arm@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/android-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/android-x64@0.25.10
│ ├── @esbuild/darwin-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/darwin-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/freebsd-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/freebsd-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-arm@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-ia32@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-loong64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-mips64el@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-ppc64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-riscv64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-s390x@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/linux-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/netbsd-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/netbsd-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/openbsd-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/openbsd-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/openharmony-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/sunos-x64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/win32-arm64@0.25.10
│ ├── UNMET OPTIONAL DEPENDENCY @esbuild/win32-ia32@0.25.10
│ └── UNMET OPTIONAL DEPENDENCY @esbuild/win32-x64@0.25.10
There is also an issue where the server functions are not being found by the netlify deploy which are built to the .netlify directory. To get around this, I needed to add the functions to my netlify.toml. This is not listed in the start documentation so does this also need to added? Is this correct?
[build]
command = "vite build"
publish = "dist/client"
functions = ".netlify/v1/functions"
[build]
command = "vite build"
publish = "dist/client"
functions = ".netlify/v1/functions"
Why is the publish value set todist/client? We want to deploy/publish the dist/server directory too right? This was all working in 1.31.x but now 1.32.x is blowing up. I'm not sure if this is a tanstack issue or a netlify issue. Any advice or directions on this would be highly appreciated. After all this, it turns out that it was the netlify-cli which is installed globally and not in the project. Updated that and it worked. Urgh....
deep-jade
deep-jade3d ago
good catch cc @Netlify (Partner) maybe worth calling this out in the docs

Did you find this page helpful?