Based on the knowledge sources, I can see that your issue with Nuxt Bridge is related to recent changes in the unenv package and its integration with Nitro.
The error you're experiencing appears to be related to path resolution issues with the unenv package, specifically with the mock proxy module. This is similar to issues that have been reported in Nuxt 3 after upgrading to newer versions.
From the knowledge sources, I can see that:
-
There have been significant changes to unenv with the upgrade to version 2, which has caused compatibility issues with Nitro and Nuxt as mentioned in this PR.
-
There are known issues with hoisting on unenv that have been addressed in newer versions of Nuxt with a new mocked-exports approach as noted in this PR.
-
Similar errors have been reported by users after upgrading to Nuxt 3.16.0, related to unenv dependencies as discussed in this issue.
To solve this issue, you could try:
- Manually adding
unenv as a dev dependency:
npm install -D unenv
or
yarn add -D unenv
- Clean your project's dependencies and reinstall:
rm -rf node_modules .nuxt .output
npm install
-
Make sure you're using compatible versions of Nuxt Bridge and Nitro. The knowledge sources indicate that Nuxt Bridge requires specific configurations for Nitro to work properly as documented here.
-
Check your nuxt.config.ts to ensure you have properly configured Bridge with Nitro:
import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({
bridge: {
nitro: true
}
})