Closed cossssmin closed 2 months ago
Since @nuxtjs/sitemap@6.0 our builds have started failing on Netlify.
@nuxtjs/sitemap@6.0
It looks like it's failing because of unocss/core though we're not directly using that - seeing the logs, is it perhaps coming from nuxt-og-image?
unocss/core
nuxt-og-image
[private repo, cannot make public on stackblitz]
Successful deploy as currently with v5.x.
Here's a part of the deploy log, it does a 500 for basically every OG image we have.
Note: currently works fine with @nuxtjs/sitemap@5.3.4
@nuxtjs/sitemap@5.3.4
1:29:25 PM: [error] [nuxt] [request error] [unhandled] [500] Cannot find package '@unocss/core' imported from /opt/build/repo/.nuxt/prerender/chunks/_/renderer.mjs 1:29:25 PM: at packageResolve (node:internal/modules/esm/resolve:854:9) 1:29:25 PM: at moduleResolve (node:internal/modules/esm/resolve:927:18) 1:29:25 PM: at defaultResolve (node:internal/modules/esm/resolve:1169:11) 1:29:25 PM: at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12) 1:29:25 PM: at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25) 1:29:25 PM: at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38) 1:29:25 PM: at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40) 1:29:25 PM: at link (node:internal/modules/esm/module_job:95:36) 1:29:25 PM: [log] [nitro] āā /work (117ms) 1:29:25 PM: [log] [nitro] āā /design (116ms) 1:29:25 PM: [error] [nuxt] [request error] [unhandled] [500] Cannot find package '@unocss/core' imported from /opt/build/repo/.nuxt/prerender/chunks/_/renderer.mjs 1:29:25 PM: at packageResolve (node:internal/modules/esm/resolve:854:9) 1:29:25 PM: at moduleResolve (node:internal/modules/esm/resolve:927:18) 1:29:25 PM: at defaultResolve (node:internal/modules/esm/resolve:1169:11) 1:29:25 PM: at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12) 1:29:25 PM: at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25) 1:29:25 PM: at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38) 1:29:25 PM: at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40) 1:29:25 PM: at link (node:internal/modules/esm/module_job:95:36) 1:29:25 PM: [error] [nuxt] [request error] [unhandled] [500] Cannot find package '@unocss/core' imported from /opt/build/repo/.nuxt/prerender/chunks/_/renderer.mjs 1:29:25 PM: at packageResolve (node:internal/modules/esm/resolve:854:9) 1:29:25 PM: at moduleResolve (node:internal/modules/esm/resolve:927:18) 1:29:25 PM: at defaultResolve (node:internal/modules/esm/resolve:1169:11) 1:29:25 PM: at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12) 1:29:25 PM: at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25) 1:29:25 PM: at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38) 1:29:25 PM: at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40) 1:29:25 PM: at link (node:internal/modules/esm/module_job:95:36) 1:29:25 PM: [log] [nitro] āā /strategy (115ms) 1:29:25 PM: [log] [nitro] āā /contact (114ms) 1:29:25 PM: [log] [nitro] āā /__og-image__/image/og.jpg (154ms) 1:29:25 PM: ā āāā Error: [500] 1:29:25 PM: ā āāā Linked from /
This is our package.json:
package.json
{ "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "devDependencies": { "@nuxt/content": "2.13.2", "@nuxtjs/google-fonts": "^3.2.0", "@nuxtjs/sitemap": "^5.3.4", "@tailwindcss/forms": "^0.5.8", "@tailwindcss/typography": "^0.5.15", "@vueuse/core": "^11.0.1", "@vueuse/nuxt": "^11.0.3", "autoprefixer": "^10.4.20", "nuxt": "^3.13.0", "nuxt-og-image": "^3.0.0-rc.66", "postcss": "^8.4.44", "postcss-import": "^16.1.0", "sharp": "^0.33.5", "tailwindcss": "^3.4.10" }, "dependencies": { "radix-vue": "^1.9.5" } }
This is our nuxt.config.ts:
nuxt.config.ts
export default defineNuxtConfig({ css: ['@/assets/css/tailwind.css'], modules: [ '@vueuse/nuxt', 'radix-vue/nuxt', 'nuxt-og-image', '@nuxt/content', '@nuxtjs/sitemap', ['@nuxtjs/google-fonts', { families: { Inter: [300, 400, 500, 600, 700], }, subsets: ['latin', 'latin-ext'], }], ], ogImage: { defaults: { extension: 'jpg', }, }, postcss: { plugins: { tailwindcss: {}, autoprefixer: {}, }, }, site: { url: 'https://alter.email', }, spaLoadingTemplate: false, typescript: { shim: false, }, devtools: { enabled: true }, })
Hmm strange can you try doing a nuxi upgrade --force?
nuxi upgrade --force
This is indeed a dependency of the og image module.
Will do and report back, thanks!
That did it, thanks man!
š The bug
Since
@nuxtjs/sitemap@6.0
our builds have started failing on Netlify.It looks like it's failing because of
unocss/core
though we're not directly using that - seeing the logs, is it perhaps coming fromnuxt-og-image
?š ļø To reproduce
[private repo, cannot make public on stackblitz]
š Expected behavior
Successful deploy as currently with v5.x.
ā¹ļø Additional context
Here's a part of the deploy log, it does a 500 for basically every OG image we have.
Note: currently works fine with
@nuxtjs/sitemap@5.3.4
This is our
package.json
:This is our
nuxt.config.ts
: