Deploying basic Tanstack Start app to Netlify gives 404 - 'dist' folder not found
I went to https://tanstack.com/start/latest/docs/framework/react/examples/start-basic and clicked 'Deploy to Netlify' without editing a single letter of code.
It creates a repo on my gitlab account and goes through deployment on Netlify, so far so good.
Deployment fails however with the following error message:
Configuration error
1:26:47 PM: ────────────────────────────────────────────────────────────────
1:26:47 PM:
1:26:47 PM: Error message
1:26:47 PM: Deploy did not succeed: Deploy directory 'dist' does not exist
1:26:47 PM:
1:26:47 PM: Resolved config
1:26:47 PM: build:
1:26:47 PM: command: npm run build
1:26:47 PM: commandOrigin: ui
1:26:47 PM: publish: /opt/build/repo/dist
1:26:47 PM: publishOrigin: ui
When I run the build command locally, it does in fact NOT create a 'dist' folder, instead a .output and .vinxi folder is created.
Changing the deployment settings in Netlify to either one of these folders results in a successful deployment, but when I then go to the site Netlify gives me a 404 error:
"Site not found
Looks like you followed a broken link or entered a URL that doesn’t exist on Netlify.
If this is your site, and you weren’t expecting a 404 for this path, please visit Netlify’s “page not found” support guide for troubleshooting tips."
That support guide has not proven very helpful, it just basically says the 'dist' folder must be set as publish directory. Again, that is not created at buildtime.
WHo can shed some light on this? thanks in advance!
It creates a repo on my gitlab account and goes through deployment on Netlify, so far so good.
Deployment fails however with the following error message:
Configuration error
1:26:47 PM: ────────────────────────────────────────────────────────────────
1:26:47 PM:
1:26:47 PM: Error message
1:26:47 PM: Deploy did not succeed: Deploy directory 'dist' does not exist
1:26:47 PM:
1:26:47 PM: Resolved config
1:26:47 PM: build:
1:26:47 PM: command: npm run build
1:26:47 PM: commandOrigin: ui
1:26:47 PM: publish: /opt/build/repo/dist
1:26:47 PM: publishOrigin: ui
When I run the build command locally, it does in fact NOT create a 'dist' folder, instead a .output and .vinxi folder is created.
Changing the deployment settings in Netlify to either one of these folders results in a successful deployment, but when I then go to the site Netlify gives me a 404 error:
"Site not found
Looks like you followed a broken link or entered a URL that doesn’t exist on Netlify.
If this is your site, and you weren’t expecting a 404 for this path, please visit Netlify’s “page not found” support guide for troubleshooting tips."
That support guide has not proven very helpful, it just basically says the 'dist' folder must be set as publish directory. Again, that is not created at buildtime.
WHo can shed some light on this? thanks in advance!
An example showing how to implement Start Basic in React using TanStack Start.
