#SSR deploy on Netlify fails with bundler errors

1 messages · Page 1 of 1 (latest)

half ridge
#

I'm trying to deploy a new Astro site (well, really an existing site rewritten from Next to Astro) on Netlify. I'm using output: "hybrid" to use SSR for a few "api" endpoints. The endpoints work locally using astro dev, but deploying to Netlify produces errors like this when Netlify bundles the functions produced by Astro:

3:37:32 PM: ▲ [WARNING] Ignoring this import because node_modules/path-to-regexp/dist/index.js was marked as having no side effects
3:37:32 PM:     .netlify/functions-internal/chunks/favicon@[email protected]:7:7:
3:37:32 PM:       7 │ import 'path-to-regexp';

The deploy then fails with Build script returned non-zero exit code: 2 (even though the actual build step worked just fine).

#

I think I figured it out 🤦‍♂️ I had the wrong publish setting in my netlify.toml

#

(TIL Netlify will sometimes say the Build step failed when actually the error messages are in the Deploy step. The logs are not always shown in chronological order apparently 😵 )