nuxt / nuxt

The Intuitive Vue Framework.

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No export named 'consola' after upgrading to `v3.11.2`

beselig opened this issue Β· comments

Environment

  • Operating System: Darwin
  • Node Version: v20.12.2
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: -
  • Package Manager: npm@10.7.0
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

I cannot link to a repository right now. The problem appears to be within nuxt v3.11.2. I didn't test prior patch versions, but v3.10.3 works just fine.

Describe the bug

I upgraded an existing project to nuxt v3.11.2, causing an error, seemingly related to the consola dependency, when running nuxt dev.

Additional context

No response

Logs

ERROR  [worker reload] [worker init] The requested module 'file:///Users/xyz/projects/foo/node_modules/consola/dist/consola.js' does not provide an export named 'consola'                                    12:02:43 PM

  import { consola } from '/Users/xyz/projects/foo/node_modules/consola/dist/consola.js';
  ^^^^^^^
  SyntaxError: The requested module '/Users/xyz/projects/foo/node_modules/consola/dist/consola.js' does not provide an export named 'consola'
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
  at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
  at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
  at async loadESM (node:internal/process/esm_loader:28:7)
  at async handleMainPromise (node:internal/modules/run_main:113:12)

For everyone, wondering how to downgrade Nuxt.

use "nuxt": "3.10.3" insted of "nuxt": "^3.10.3"

The ^ cast a new version.

Likely you have another dependency with an outdated consola dependency which is causing an old one to be installed.

Try ensuring you update consola - either by explicitly installing it, by refreshing your lockfile, or by identifying the package that has an old version and updating it.

Would you be able to provide a reproduction? πŸ™

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

πŸ‘‰ https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
πŸ‘‰ https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. πŸ‘Œ

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful: