nuxt-modules / og-image

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

fix: Duplicated Import #254

Closed moshetanzer closed 1 month ago

moshetanzer commented 2 months ago

🐛 The bug

Hey @harlan-zw

Getting this in dev:


[9:07:21 PM]  WARN  Duplicated imports "OgImage", the one from "/Users/test/Desktop/test/app/components/OgImage.vue?nuxt_component=server&nuxt_component_name=OgImage&nuxt_component_export=default" has been ignored and "/Users/test/Desktop/test/node_modules/.pnpm/nuxt-og-image@3.0.0-rc.64_magicast@0.3.4_rollup@4.19.1_vite@5.3.5_@types+node@22.0.0_terser@5_shkvwjghbg4u6cyqrbuhnseimi/node_modules/nuxt-og-image/dist/runtime/nuxt/components/OgImage/OgImage" is used

[9:07:21 PM]  WARN  Duplicated imports "LazyOgImage", the one from "/Users/test/Desktop/test/app/components/OgImage.vue?nuxt_component=server,async&nuxt_component_name=OgImage&nuxt_component_export=default" has been ignored and "/Users/test/Desktop/test/node_modules/.pnpm/nuxt-og-image@3.0.0-rc.64_magicast@0.3.4_rollup@4.19.1_vite@5.3.5_@types+node@22.0.0_terser@5_shkvwjghbg4u6cyqrbuhnseimi/node_modules/nuxt-og-image/dist/runtime/nuxt/components/OgImage/OgImage?nuxt_component=async&nuxt_component_name=OgImage&nuxt_component_export=default" is used

🛠️ To reproduce

just start up nuxt v4 with this

🌈 Expected behavior

this not to occur

ℹ️ Additional context

No response

harlan-zw commented 2 months ago

Hi, I think this is expected as you have copied over the component using the same name by the looks of it? You should rename the component to use avoid this error.

Docs may need to be updated if it's directing people to do this.

moshetanzer commented 2 months ago

Hey @harlan-zw not sure I get what you mean. I can’t have a component called OgImage. I don’t have lazyogimage anywhere. And this is the only oh image I have.

harlan-zw commented 2 months ago

Nuxt will automatically generate Lazy components from all your existing components so you should ignore that.

Looking at the error it's saying there's two components:

Can you double-check that this doesn't exist /Users/test/Desktop/test/app/components/OgImage.vue