Removing support for import assertions in Edge Functions

Support for import assertions in Edge Functions is being deprecated. This syntax originated from an early standards proposal that had only been implemented in Chrome, Node.js and Deno. Because it was available on Deno, it was available on Netlify Edge Functions.

This proposal has since undergone major changes, including a rename of the `assert` keyword to `with`. Unfortunately, this means a breaking change for any code using the older syntax.

What do I need to do?

If you’re using this syntax in your edge functions, you must update any imports to the import attributes syntax.

// Before ❌
import data from "./data.json" assert { type: "json" };

// After ✅
import data from "./data.json" with { type: "json" };

No further changes are needed.

How long do I have?

Support for import assertions has been removed from Deno with the 2.0 release. We want to offer the latest features of the runtime on our platform, but we want to make sure that you have enough time to update your projects.

So even though we’re defaulting to Deno 2.0 right now, we’re continuing to offer support for import assertions until January 31st, 2026. After this date, any edge functions using import assertions will cause your builds to fail.

My builds are already failing

To offer backwards-compatible support for import assertions on top of Deno 2.0, we must take some steps to transform your code to the new syntax. In rare cases, this might fail and will cause your builds to fail.

If this is happening to you, we advise you to take these steps:

If you continue to experience any issues, please share a message on this thread.

We’re sorry for any inconvenience this may cause you, but we appreciate your help in moving the JavaScript standards forward for a better web.

1 Like