Our volunteer developer created a web app for my nonprofit Altadena Rising (supporting Eaton Fire victims in Los Angeles), handed over the source code and then abruptly left the project. The app allows fire victims to share their stories and post them on a map of the town.
I am migrating his work from his Vercel environment to our Netlify environment. I got it up and running locally but I have not been able to deploy it using Netlify yet. I’m not a professional developer and have been using cursor & claude to work on this.
I am getting this build error:
8:09:58 PM: The following serverless functions failed to deploy: _@astrojs-ssr-adapter
8:09:58 PM: To deploy these functions successfully, change the function names to contain only alphanumeric characters, hyphens or underscores
I thought this was addressed by adding included_files = ["**/*"]
to my netlify.toml
:
[build]
base = "www"
command = "npm install && npm run build"
publish = "dist"
functions = ".netlify/build"
[[redirects]]
from = "/*"
to = "/.netlify/functions/entry"
status = 200
[dev]
framework = "astro"
targetPort = 4321
# Domain configuration
[context.production]
environment = { URL = "https://stories.altadenarising.org" }
[functions]
directory = ".netlify/build"
node_bundler = "esbuild"
external_node_modules = ["@astrojs/ssr"]
included_files = ["**/*"]
[build.environment]
NODE_VERSION = "18"
The “Why did it fail” AI failure analysis looks like an unrelated issue:.
Solution: To resolve this issue:
Verify if the package supporting the top-level await ('astro/env/setup') is included in the package.json or was committed to the repository.
Since top-level await is not supported with the 'cjs' output format, you may need to adjust the bundler configuration or the usage of top-level await in the code.
After addressing these points, trigger a new build to ensure the issue is resolved.
I believe that I already addressed this issue by following these steps:
**How to Implement ESM Configuration for Astro on Netlify**
Here's a brief explanation of how to implement Option 1 (updating your Astro configuration to use ESM):
1. Locate your Astro configuration file: Find your astro.config.mjs (or astro.config.js) file in your project's root directory.
2. Update the configuration: Modify your Astro config file to explicitly set the output format to ESM. You'll need to add Vite build options that specify ESM as the format.
3. Update Netlify configuration: Create or modify your netlify.toml file in the project root to ensure it supports ESM.
4. Verify Node.js version: Make sure your Netlify environment uses Node.js version 16 or higher (18+ recommended) to properly support ESM.
5. Update package.json: Check that your package.json has "type": "module" to indicate your project uses ESM.
6. Redeploy your application: Push your changes and redeploy on Netlify.
7. Check build logs: After deployment, check the Netlify build logs to confirm the error is resolved.
I appreciate any help. At this point I would be happy to pay someone to help us get this up and running becuase we have several people that want to add their stories about the fire.
Also, I could make the repo public if that helps. The code will be open sourced for other disaster victims once it’s functioning.