harlan-zw / nuxt-seo

The complete SEO solution for Nuxt.
https://nuxtseo.com
949 stars 56 forks source link

Does not provide an export named 'execa' after install #217

Closed richard-edwards closed 2 months ago

richard-edwards commented 2 months ago

Describe the bug

I removed nuxt-og-image from my project and installed nuxt-seo, set up the module in nuxt.config.ts etc and now I'm getting this on run dev:

gpp-web:dev: [10:14:28 a.m.]  ERROR  [worker reload] [worker init] The requested module 'file:///home/richard/Projects/golfpro/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js' does not provide an export named 'execa'
gpp-web:dev: 
gpp-web:dev:   import { execa } from '/home/richard/Projects/golfpro/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js';
gpp-web:dev:   ^^^^^
gpp-web:dev:   SyntaxError: The requested module '/home/richard/Projects/golfpro/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js' does not provide an export named 'execa'
gpp-web:dev:   at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
gpp-web:dev:   at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
gpp-web:dev: 

Reproduction

No response

System / Nuxt Info

------------------------------
- Operating System: Linux
- Node Version:     v18.18.2
- Nuxt Version:     3.10.3
- CLI Version:      3.10.1
- Nitro Version:    2.8.1
- Package Manager:  pnpm@8.15.4
- Builder:          -
- User Config:      debug, site, vite, build, watch, typescript, extends, modules, components, ui, fontMetrics, googleFonts, imports, app, runtimeConfig, supabase, dayjs, devtools
- Runtime Modules:  @nuxtjs/supabase@1.1.7, @pinia/nuxt@0.5.1, @nuxt/content@2.12.1, @nuxt/image@1.4.0, @nuxt/ui, @nuxtjs/fontaine@0.4.1, @nuxtjs/google-fonts@3.1.3, @vueuse/nuxt@10.9.0, @vue-email/nuxt@0.8.19, dayjs-nuxt@2.1.9, @nuxtjs/seo@2.0.0-rc.10
- Build Modules:    -
------------------------------
harlan-zw commented 2 months ago

The problem is that one of your dependencies has locked execa to an earlier version. It's not an issue with this module exactly, just that the module is using Nuxt internals features that use execa v8.

You can debug it by running pnpm why execa and finding what is keeping it at 5.1.1

richard-edwards commented 2 months ago

Thanks. Looks like it was eslint-plugin-prettier-vue but I was already using the latest so no way for me to upgrade it. I'm wondering if I can pin execa to v8 somehow. Looks like some other packages like unocss and @unocss/preset-icons also use it but if I remove just eslint-plugin-prettier-vue I have no error now.

harlan-zw commented 2 months ago

Yes pinning it should work although may break the eslint plugin, I'd recommend using https://github.com/nuxt/eslint. Nothing else I can do on my end so going to close this.