Sveltekit - why Netlify run localserver

Hello everybody,
can you please help me to resolve, why Netlify doesnt want to me run build and start site.
Everytime when i start deploy at Netlify by GUI, finished at localserver (please see bellow)

I use github for connection to my project.
FW - SvelteKit
Domain: calm-longma-21881c.netlify.app

Thank you
Jiri

Log

11:13:18 AM: Build ready to start

11:13:20 AM: build-image version: 0e2f4c52031ab562db66aec633308326e3b108d0 (focal)

11:13:20 AM: build-image tag: focal

11:13:20 AM: buildbot version: 92fdf6c9673723ad7f3b62ee278f375a17a73dd6

11:13:20 AM: Fetching cached dependencies

11:13:20 AM: Failed to fetch cache, continuing with build

11:13:20 AM: Starting to prepare the repo for build

11:13:21 AM: No cached dependencies found. Cloning fresh repo

11:13:21 AM: git clone https://github.com/mikigroup/sanity-svelte

11:13:22 AM: Preparing Git Reference refs/heads/Flowbite_svelte

11:13:22 AM: Parsing package.json dependencies

11:13:23 AM: Starting build script

11:13:23 AM: Installing dependencies

11:13:23 AM: Python version set to 2.7

11:13:24 AM: Downloading and installing node v16.16.0…

11:13:24 AM: Downloading https://nodejs.org/dist/v16.16.0/node-v16.16.0-linux-x64.tar.xz

11:13:25 AM: Computing checksum with sha256sum

11:13:25 AM: Checksums matched!

11:13:28 AM: Now using node v16.16.0 (npm v8.11.0)

11:13:28 AM: Started restoring cached build plugins

11:13:28 AM: Finished restoring cached build plugins

11:13:28 AM: Attempting ruby version 2.7.2, read from environment

11:13:29 AM: Using ruby version 2.7.2

11:13:29 AM: Using PHP version 8.0

11:13:30 AM: No npm workspaces detected

11:13:30 AM: Started restoring cached node modules

11:13:30 AM: Finished restoring cached node modules

11:13:30 AM: Installing NPM modules using NPM version 8.11.0

11:13:31 AM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special

11:13:31 AM: npm WARN config location in the cache, and they are managed by

11:13:31 AM: npm WARN config cacache.

11:13:31 AM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special

11:13:31 AM: npm WARN config location in the cache, and they are managed by

11:13:31 AM: npm WARN config cacache.

11:13:33 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported

11:13:34 AM: 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 There’s Math.random(), and then there’s Math.random() · V8 for details.

11:13:34 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see

11:13:36 AM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

11:13:39 AM: > sanity-svelte@0.0.1 prepare

11:13:39 AM: > vite sync

11:13:39 AM: VITE v3.0.0 ready in 224 ms

11:13:39 AM: ➜ Local: http://localhost:5173/

11:13:39 AM: ➜ Network: use --host to expose

11:13:39 AM: (!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

@mikigroup The build system is intended to run, produce an output folder of files, deploy the output folder to CDN, then cease execution.

In the case of vite you should do a vite build and set your Publish Directory in Netlify to dist.

If you do need to handle requests and provide responses you could use Functions or host somewhere else like heroku.

Thank you so much for fast reply @nathanmartin !

Understand. I use script in file package.json for this project.

scripts": {
“dev”: “vite dev”,
“build”: “vite build”,
“package”: “vite package”,
“preview”: “vite preview”,
“prepare”: “vite sync”,
“check”: “svelte-check --tsconfig ./jsconfig.json”,
“check:watch”: “svelte-check --tsconfig ./jsconfig.json --watch”,
“lint”: “prettier --check --plugin-search-dir=. .”,
“format”: “prettier --write --plugin-search-dir=. .”

So if i write “npm run dev” = “vite dev”

And if i try localy run npm run dev or build, everything is all right. Build is working. Only at netlify is not working. Mb git change some files_?

And very stange is, that i can see in log
11:13:39 AM: > vite sync

But should run vite build. Again, if i try it localy, it works, npm run dev = vite dev, npm run build = vite build. Why Netlify run vite sync? Where decide to use that?

Use this for fix donest help me, its same.

Build settings
Base directory
Not set
Build command
vite build
Publish directory
build
Builds
Active

Thank you @nathanmartin
Jiri

@mikigroup I would probably try deleting the "prepare" script.

Then ensure that your Build settings have the Build command set to npm run build.

@nathanmartin this script is build element for sveltekit, it cannot be deleted or dont use, just sveltekit change this little bit. Look at that Svelte-Kit Dev Is No Longer Available Use Vite Dev Instead - YouTube.
I cannot use old version of sveltekit with “sveltekit build” command. “npm run dev” was “sveltekit build”, now is “npm run build” “vite build”, thats all. But why localy is working and at Netlify not, that is strange. MB this can help you?

Thakn you
Jiri

Sorry but I don’t really understand anything that you’ve said.

If you check this, you’ll find that this person indicates they had the same issue with Vercel, and that they found that deleting the prepare script from the the package.json allowed it to build:

Sorry for my english and thank you @nathanmartin , problem is resolved.

Best Wishes
Jiri