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).