nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
415 stars 27 forks source link

[vite]: Rollup failed to resolve import "@vueuse/head" from "D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/nuxt-og-image/dist/runtime/composables/defineOgImage.mjs" #39

Closed JenuelDev closed 1 year ago

JenuelDev commented 1 year ago

Describe the bug

Just got an error on the latest nuxt update.. after building, this shows up.

❯ yarn build
yarn run v1.22.19
$ nuxt build
Nuxi 3.4.1                                                                                                  8:08:41 PM

[8:08:48 PM]  ERROR  [vite]: Rollup failed to resolve import "@vueuse/head" from "D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/nuxt-og-image/dist/runtime/composables/defineOgImage.mjs".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external

[8:08:48 PM]  ERROR  [vite]: Rollup failed to resolve import "@vueuse/head" from "D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/nuxt-og-image/dist/runtime/composables/defineOgImage.mjs".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
  This is most likely unintended because it can break your application at runtime.
  If you do want to externalize this module explicitly add it to
  build.rollupOptions.external
  at onRollupWarning (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/vite/dist/node/chunks/dep-79892de8.js:46368:19)   
  at onwarn (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/vite/dist/node/chunks/dep-79892de8.js:46138:13)
  at Object.onwarn (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/rollup/dist/es/shared/node-entry.js:25149:13)       
  at ModuleLoader.handleInvalidResolvedId (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/rollup/dist/es/shared/node-entry.js:23784:26)
  at /D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/rollup/dist/es/shared/node-entry.js:23744:26

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

image

Reproduction

https://github.com/BroJenuel/BroJenuelBlog/tree/development

System / Nuxt Info

------------------------------
- Operating System: Windows_NT
- Node Version:     v18.14.0
- Nuxt Version:     3.4.1
- Nitro Version:    2.3.3
- Package Manager:  yarn@1.22.19
- Builder:          vite
- User Config:      ssr, modules, colorMode, routeRules, runtimeConfig, css, app
- Runtime Modules:  @vueuse/nuxt@9.13.0, @pinia/nuxt@0.4.8, nuxt-icon@0.2.11, @nuxtjs/color-mode@3.2.0, nuxt-windicss@2.6.1, @nuxtjs/supabase@0.3.5, nuxt-og-image@1.5.7
- Build Modules:    -
------------------------------
JenuelDev commented 1 year ago

it seems like installing "@vueuse/head" solve the problem but do I have to install it though?

oneart-dev commented 1 year ago

Same issue after upgrading to latest nuxt version

sawa-ko commented 1 year ago

Same here

harlan-zw commented 1 year ago

Thanks for the issue!

This is fixed in the latest versions: v1.5.8, v2.0.0-beta.17.