# Function not found error when using netlify dev with sveltekit

**URL:** <https://answers.netlify.com/t/function-not-found-error-when-using-netlify-dev-with-sveltekit/114913>\
**Category:** Support\
**Tags:** netlify-cli, svelte, netlify-newbie\
**Created:** [March 20, 2024, 1:20pm UTC](https://answers.netlify.com/t/function-not-found-error-when-using-netlify-dev-with-sveltekit/114913 "2024-03-20T13:20:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewwildgoose](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrewwildgoose/32/59708_2.png) [@andrewwildgoose](https://answers.netlify.com/u/andrewwildgoose)\
**Post date:** [March 20, 2024, 1:20pm UTC](https://answers.netlify.com/t/function-not-found-error-when-using-netlify-dev-with-sveltekit/114913/1 "2024-03-20T13:20:00Z")

</div>

Hi, I’m trying to use the Netlify image CDN to deliver images to my sveltekit site. I’m trying to test it using the `netlify dev` command to test it locally.

When I run `netlify dev` i get the following console output:

```auto

◈ Netlify Dev ◈
◈ Injecting environment variable values for all scopes
◈ Ignored general context env var: LANG (defined in process)
◈ Ignored site settings env var: MAPBOX_API_ACCESS_TOKEN (defined in .env file)
◈ Injected .env file env var: MAPBOX_API_ACCESS_TOKEN
◈ Injected site settings env var: NETLIFY_AUTH_TOKEN
◈ Injected netlify.toml file env var: NODE_ENV
◈ Injected netlify.toml file env var: targetport
◈ Injected netlify.toml file env var: port
◈ Injected netlify.toml file env var: command
◈ Injected netlify.toml file env var: framework
◈ Injected .env file env var: BASE_URL
◈ Setting up local development server
Cleaned up .netlify\functions-internal.
◈ Starting Netlify Dev with SvelteKit

> 19mil-site-2024@0.0.1 dev
> vite dev

  VITE v5.0.12 ready in 1592 ms

  ➜ Local: http://localhost:5173/
  ➜ Network: use --host to expose
✔ Waiting for framework port 5173. This can be configured using the 'targetPort' property in the netlify.toml

   ┌─────────────────────────────────────────────────┐
   │ │
   │ ◈ Server now ready on http://localhost:8888 │
   │ │
   └─────────────────────────────────────────────────┘

◈ Rewrote URL to /.netlify/functions/sveltekit-render.js
Request from ::ffff:127.0.0.1: GET /.netlify/functions/sveltekit-render.js
Response with status 404 in 2 ms.

```

And when I visit `localhost:8888` i get a 404 response saying 'funtion not found . . . ’

This is the Dev Context in my netlify.toml:

```auto
# Dev context: environment variables set here
# are available for local development environments
# run using Netlify Dev. These values can be
# overwritten on branches that have a more specific
# branch context configured.
[context.dev.environment]
  NODE_ENV = "development"
  targetport = 5173
  port = 8888
  command = "npm run dev"
  framework = "custom"

```

I’m not trying to use any edge functions. My .netlify/ directory has the following structure:

```auto
.netlify/
- blobs-serve/
-functions-internal/
-plugins/
-server/
-servless.js
-shims.js
-state.json

```

Let me know if any other information is required to help fix.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [March 24, 2024, 10:14am UTC](https://answers.netlify.com/t/function-not-found-error-when-using-netlify-dev-with-sveltekit/114913/2 "2024-03-24T10:14:47Z")

</div>

> [@andrewwildgoose](#):
>
> ```auto
> ◈ Rewrote URL to /.netlify/functions/sveltekit-render.js
> Request from ::ffff:127.0.0.1: GET /.netlify/functions/sveltekit-render.js
> 
> ```

You seem to have configured some Netlify Redirects somewhere in your project. Removing those should fix this.

---

<div class="post-metadata">

**Author:** ![andrewwildgoose](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/andrewwildgoose/32/59708_2.png) [@andrewwildgoose](https://answers.netlify.com/u/andrewwildgoose)\
**Post date:** [April 3, 2024, 11:24am UTC](https://answers.netlify.com/t/function-not-found-error-when-using-netlify-dev-with-sveltekit/114913/3 "2024-04-03T11:24:59Z")

</div>

Hi Hrishikesh, I haven’t done that directly, it must have been done automatically by netlify. I don’t have a /functions directory nor a file called sveltekit-render.js. I’ve searched my project for both of those and have returned no results. Do you know how I can remove the redirects?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [April 4, 2024, 7:05am UTC](https://answers.netlify.com/t/function-not-found-error-when-using-netlify-dev-with-sveltekit/114913/4 "2024-04-04T07:05:09Z")

</div>

> [@andrewwildgoose](#):
>
> it must have been done automatically by netlify. I don’t have a /functions directory nor a file called sveltekit-render.js.

SvelteKit’s Netlify adapter adds that redirect and also generates the function. Check your publish directory or simply clone your project fresh in a new folder to see if you still reproduce this.
