# @netlify/edge-bundler and next-dev edge functions causing type errors

**URL:** <https://answers.netlify.com/t/netlify-edge-bundler-and-next-dev-edge-functions-causing-type-errors/84526>\
**Category:** Support\
**Tags:** netlify-dev-open-beta, netlify-cli, nextjs\
**Created:** [February 1, 2023, 3:39pm UTC](https://answers.netlify.com/t/netlify-edge-bundler-and-next-dev-edge-functions-causing-type-errors/84526 "2023-02-01T15:39:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyljmn-mg](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kyljmn-mg](https://answers.netlify.com/u/kyljmn-mg)\
**Post date:** [February 1, 2023, 3:39pm UTC](https://answers.netlify.com/t/netlify-edge-bundler-and-next-dev-edge-functions-causing-type-errors/84526/1 "2023-02-01T15:39:56Z")

</div>

Netlify generated files (from running `netlify dev`) causing type errors when running NextJS app.  
Files might have something to do with `next-dev` edge function. Is there a way to disable this?

Said files are:

```auto
- netlify-cli/node_modules/@netlify/edge-bundler/deno/config.ts:7:10 (globally installed package)
- .netlify/edge-functions/edge-shared/utils.ts

```

Here is the complete error:

```auto
Found 2 errors.
    at async file:///home/kyljmn/.asdf/installs/nodejs/16.10.0/.npm/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/deno/config.ts:7:10
Could not load edge function at '/home/kyljmn/Documents/work/metrobank-next/.netlify/edge-functions/next-dev/index.js'
TypeError: TS2345 [ERROR]: Argument of type 'URL' is not assignable to parameter of type 'string'.
    return Response.redirect(url, 308)
                             ~~~
    at file:///home/kyljmn/Documents/work/metrobank-next/.netlify/edge-functions/edge-shared/utils.ts:266:30

TS2345 [ERROR]: Argument of type 'URL' is not assignable to parameter of type 'string'.
    return Response.redirect(url, 308)
                             ~~~
    at file:///home/kyljmn/Documents/work/metrobank-next/.netlify/edge-functions/edge-shared/utils.ts:271:30

```

Using `netlify-cli` version `12.10.0`, however, I’ve downgraded to some previous versions (`11.x.x.` and `10.x.x`) finally got it to work at `6.9.28` but the netlify function I need (different from the said edge function causing the error) doesn’t work as expected in that version.

---

<div class="post-metadata">

**Author:** ![p.aarseth](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/p.aarseth/32/24947_2.png) [@p.aarseth](https://answers.netlify.com/u/p.aarseth)\
**Post date:** [February 11, 2023, 3:24pm UTC](https://answers.netlify.com/t/netlify-edge-bundler-and-next-dev-edge-functions-causing-type-errors/84526/4 "2023-02-11T15:24:04Z")

</div>

do you have deno installed on your system?

Got the same error, realised I hadn’t installed deno, installed deno via homebrew, error disappeared afterwards.

---

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [February 11, 2023, 7:06pm UTC](https://answers.netlify.com/t/netlify-edge-bundler-and-next-dev-edge-functions-causing-type-errors/84526/5 "2023-02-11T19:06:31Z")

</div>

Hi @p.aarseth 👋🏿 thanks so much for sharing your solution!

---

<div class="post-metadata">

**Author:** ![kyljmn-mg](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kyljmn-mg](https://answers.netlify.com/u/kyljmn-mg)\
**Post date:** [February 13, 2023, 11:52pm UTC](https://answers.netlify.com/t/netlify-edge-bundler-and-next-dev-edge-functions-causing-type-errors/84526/6 "2023-02-13T23:52:20Z")

</div>

Thanks @p.aarseth worked after installing deno!
