How to see console.log errors in the deploy log on Netlify
I was making an async shortcode in eleventy (static site generator) recently. I needed to see the errors that were logged via console.log()
or console.warn()
inside the deploy log on Netlify to troubleshoot issues.
The warning thrown from this code did not appear in the deploy log:
In order to see errors and warnings logged, I discovered that you need to have the build command include a CI
environment variable. Adding the environment variable to the start of the build command in my netlify.toml was sufficient to enable logging of my warning.
This is what you see in the deploy log…
Hope it helps! 🧑💻💕