#Netlify 'setting up the Edge Functions environment' forever
1 messages · Page 1 of 1 (latest)
Hi @nocturne shard. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
If you are seeing "setting up the Edge Functions environment" hang during local development with Astro and Netlify, it is likely because the Netlify adapter enables several platform features by default—including Edge Functions support—even if you are not using them. This is intended to make your local environment match production as closely as possible, but it can sometimes cause unnecessary setup or delays if you don't need those features.
You can control which features are enabled in local development using the devFeatures option in your Netlify adapter configuration. To specifically disable Edge Functions and related features (like the local Netlify Image CDN), set the relevant options to false in your astro.config.mjs:
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify';
export default defineConfig({
adapter: netlify({
devFeatures: {
images: false, // disables local Netlify Image CDN
// You can add other features here as needed
},
}),
});
While the documentation does not mention a direct edgeFunctions toggle, disabling features like images (which uses Edge Functions under the hood) should prevent the local environment from setting up unnecessary Edge Function support. If you continue to experience issues, ensure you are not enabling the edgeMiddleware option in your adapter config, as this explicitly enables Edge Functions for middleware execution Netlify adapter usage Local development features.
If you do not need any Netlify-specific features in development, you can also set devFeatures: false to disable all of them:
adapter: netlify({
devFeatures: false,
}),
This should help avoid the "setting up the Edge Functions environment" step during local development.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@nocturne shard Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@shadow spindle this isn't even an SSR project, it's a static site!
Let me check the knowledge base for you again. One moment! :books:
If your Astro project is a static site (i.e., you have output: 'static' in your config and are not using SSR or on-demand rendering), you generally do not need the Netlify adapter unless you require specific Netlify features, such as the Netlify Image CDN or automatic redirects translation. The adapter is only necessary for static sites if you want to use these features:
- Netlify Image CDN support
- Automatic translation of Astro
redirectsconfig to Netlify’s_redirectsfile
If you do not need these features, you can remove the Netlify adapter from your project, and Astro will output a static site that Netlify can host without any special configuration Static sites with the Netlify Adapter.
If you do need the adapter for one of those features, but want to avoid the Edge Functions environment setup in local development, you can try disabling local dev features as described previously. However, the documentation does not provide a direct way to disable only Edge Functions setup if you are using the adapter for static sites.
Summary:
- For pure static sites, you can remove the Netlify adapter unless you need Netlify-specific features.
- If you keep the adapter, some local dev features (like Edge Functions) may be enabled by default, and there is no explicit documented way to disable only Edge Functions setup in local dev.
If you are not using any Netlify-specific features, it is safe to remove the adapter to avoid unnecessary setup steps Static sites with the Netlify Adapter.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@nocturne shard Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@shadow spindle i'm using netlify dev because i use _redirects heavily for navigation and astro dev doesn't support that. any tips?
Let me check the knowledge base for you again. One moment! :books:
You're correct: astro dev does not natively support Netlify-style _redirects during local development. Using netlify dev is the recommended approach when you rely on Netlify’s redirect rules, as it emulates the Netlify environment—including _redirects and other platform features—locally Local development features.
Tips for your workflow:
- Continue using
netlify dev: This is the best way to test your_redirectslocally, as it will process your_redirectsfile and route requests accordingly, just like in production. - Keep your
_redirectsfile inpublic/: Netlify will pick up this file automatically. If you use the Netlify adapter and specify redirects in your Astro config, those will be appended to your_redirectsfile at build time Static sites with the Netlify Adapter. - Disable unnecessary dev features: If you don’t need features like the local Image CDN, you can disable them in your adapter config with
devFeaturesto speed up local startup (if you use the adapter at all).
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify';
export default defineConfig({
adapter: netlify({
devFeatures: {
images: false,
// other features as needed
},
}),
});
- Manual redirects: You can always maintain your own
public/_redirectsfile for full control, and Netlify will use it as-is.