evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.39k stars 210 forks source link

Out of memory during build #2282

Closed zachstence closed 3 months ago

hughess commented 3 months ago

Happens when running npm run build - will get a JavaScript heap out of memory error in the terminal

CleanShot 2024-07-29 at 12 06 23@2x

Workaround is to add this to the command to increase the memory: NODE_OPTIONS="--max-old-space-size=4096

@archiewood has a theory that it might be related to the MermaidJS library, as the memory issues in deployments/builds started showing up around that time

zachstence commented 3 months ago

This is also happening in our new E2E tests in macOS when building a project created from the Evidence template (with a couple small pages added)

https://github.com/evidence-dev/evidence/actions/runs/10169332555/job/28125994939

zachstence commented 3 months ago

Things I have tried without noticeable success

zachstence commented 3 months ago

Some relevant information from Rollup (used by Vite under the hood): https://rollupjs.org/troubleshooting/#error-javascript-heap-out-of-memory

archiewood commented 3 months ago

any thoughts on ripping out the (undocumented, AFAIK unused) mermaidJS lib and the component its used by