Failed during stage 'preparing site for deployment': exit status 1


I very suddenly had deploys start failing. The first error wasn’t with a code change— it was uploading an image through Netlify CMS. Everything has failed after that.

I get this error:

failed during stage 'preparing site for deployment': exit status 1

I’ve reverted to the last successfully building commit and tried clearing the cache and doing a new deploy, but that made no difference.

Here’s a couple of build logs, including the first to fail:

The site is using Eleventy, for what it’s worth. Please let me know what else I can provide that would be useful.



Thanks, Bret, I really appreciate the quick help! Adding encoding did the trick.

My deploy-succeeded.js is based very closely on Max Böck’s, and I think many other people have done the same, since he wrote a great article about it. I notice he also doesn’t have the module, so I think there’s a good chance this issue may pop up for others.

Thanks again!


FYI this issue is being tracked publicly here on GitHub and has some more information about the “why”: . It’ll also help you to know when you can remove that extra dependency since we’ll update it as we work :slight_smile:


Hello, I’ve added encoding but it didn’t work. It seems to look for './dist/react-hot-loader.production.min.js' from '/opt/build/repo/dist/lambda' I’ve never had this problem before and I didn’t touch functions. Thoughts?

12:42:06 PM: Build script success
12:42:06 PM: Starting to prepare functions from 'dist'
12:42:06 PM: Zipping functions from /opt/build/repo/dist/lambda to /tmp/zisi-087720367
12:42:07 PM: Error: Cannot find module './dist/react-hot-loader.production.min.js' from '/opt/build/repo/dist/lambda'
12:42:07 PM: Failing build: Failed to prepare functions for deployment
12:42:07 PM: failed during stage 'preparing functions for deployment': exit status 1
12:42:08 PM: Finished processing build request in 1m47.046320424s
12:42:08 PM: Shutting down logging, 0 messages pending

Edit: I’ve updated netlify-lambda to "^1.4.5" and produced a different error which seems like a separate (babel?) issue:

2:55:12 PM: Module build failed (from ../node_modules/babel-loader/lib/index.js):
2:55:12 PM: Error: Plugin/Preset files are not allowed to export objects, only functions. In /opt/build/repo/node_modules/react-static/babel-preset.js
2:55:12 PM:     at createDescriptor (/opt/build/repo/node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
2:55:12 PM:     at Object.loader (/opt/build/repo/node_modules/babel-loader/lib/index.js:56:18)
2:55:13 PM: Done in 53.07s.

Update: I figured it out. To anyone out there using react-static (older versions ~before v6.x.x) with netlify-lambda (v0.4.0), I needed to upgrade both my versions of react-static(now v7.x.x) and netlify lambda(now v1.4.5).


hey @cliffasaurus! Good job on figuring out your issue. Would you mind pulling out your question and starting a separate thread so the next person who has the same issue can find it more easily?? thanks!