#Rollup failed to resolve import "unenv/runtime/mock/noop"

1 messages · Page 1 of 1 (latest)

weary knollBOT
#

Hi @short smelt. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

This error appears to be related to a dependency resolution issue after updating to Nuxt 3.16. The error indicates that Rollup (the bundler used by Vite in Nuxt) is unable to resolve an import from the unenv/runtime/mock/noop path.

Based on the knowledge sources, there have been several recent changes in Nuxt related to dependencies and imports that might be causing this issue:

  1. There was a PR that dropped unneeded schema dependencies, including explicit dependencies on libraries like unimport and others, which could affect how dependencies are resolved GitHub PR #30411.

  2. Similar Rollup errors have been reported by other users after upgrading to newer Nuxt versions, as seen in issues #29804 and #28850.

To resolve this issue, you can try the following steps:

  1. Clear your cache and node_modules:

    rm -rf node_modules .nuxt .output
    npm cache clean --force
    npm install
    
  2. If you're using the clientNodeCompat experimental feature, make sure you're properly setting it up as mentioned in the documentation Experimental Features.

  3. Check if you have any custom Vite or Rollup configurations that might be interfering with the dependency resolution.

  4. If the issue persists, you might need to explicitly add the missing dependency to your external options in your nuxt.config.ts:

    export default defineNuxtConfig({
      vite: {
        build: {
          rollupOptions: {
            external: ['unenv/runtime/mock/noop']
          }
        }
      }
    })
    
#

This appears to be a dependency resolution issue that can happen during major version updates, especially when there have been changes to how dependencies are managed in the framework.

If these steps don't resolve your issue, you might want to consider creating a minimal reproduction of the problem and opening an issue on the Nuxt GitHub repository.

Kapa: I notice you're using Nuxt 3.16, which is quite recent, and these types of dependency resolution issues are sometimes fixed in patch releases, so also make sure you're on the latest patch version of Nuxt 3.16.x.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@short smelt Kapa.ai is still learning and improving, please let me know how I did by reacting below.

cloud acorn
#

I have the exact same issue, it just appeard today...

#

have you solved anything ?