Nuxt Content + Scalar/Nuxt will not build "JavaScript heap out of memory"
What happens?
You cannot build with both Nuxt/Content and Scalar/Nuxt configured.
Occasionally you can get it to work in Dev mode but its very slow and when you try build it always fails.
I've tried various combinations of versions of both packages but I'm unable to get content and scalar to work together.
You can easily replicate on a simple nuxt template https://github.com/nuxt-ui-templates/saas
Just add scalar to the package.json
"@scalar/nuxt": "0.5.15",
And add basic config to the nuxt config modules: [ '@nuxt/eslint', '@nuxt/image', '@nuxt/ui', '@nuxt/content', '@vueuse/nuxt', 'nuxt-og-image', '@scalar/nuxt' // add scalar ],
scalar: { url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json', // fails with both test openapi and nitro pathRouting: { basePath: '/scalar', //change base path to avoid conflict with docs content }, },
remove Content and scalar will work perfectly. remove scalar and content will work perfectly.
Environment details
- Operating System: Linux
- Node Version: v22.17.0
- Nuxt Version: 4.1.2
- CLI Version: 3.28.0
- Nitro Version: 2.12.6
- Package Manager: [email protected]
- Builder: -
- User Config: modules, scalar, devtools, css, routeRules, compatibilityDate, nitro, eslint
- Runtime Modules: @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @vueuse/[email protected], [email protected], @scalar/[email protected]
- Build Modules: -
What did you expect to happen?
Content to build its associated pages and Scalar API documentation to build be fast/responsive and accessible on /scalar.
OpenAPI Document
https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json
This could be related to an unhead pinning dependancy issue, similar to this issue
@Saganic did you have any luck getting this to work?