nuxt: [SSR] Error transforming app.vue: Cannot read properties of undefined (reading 'uid')

I’ve been getting strange warnings tonight on fresh Nuxt3 projects, both on OSX and Linux. The warnings look like the following:

 WARN  [SSR] Error transforming .../testing/app.vue: Cannot read properties of undefined (reading 'uid')                                                      

  at Object.statSync (node_modules/graceful-fs/polyfills.js:313:17)
  at isDirectory (node_modules/resolve/lib/sync.js:22:23)
  at loadNodeModulesSync (node_modules/resolve/lib/sync.js:191:17)
  at Function.resolveSync [as sync] (node_modules/resolve/lib/sync.js:98:17)
  at resolveFrom$3 (node_modules/vite/dist/node/chunks/dep-76613303.js:3911:29)
  at resolvePackageData (node_modules/vite/dist/node/chunks/dep-76613303.js:30046:19)
  at node_modules/vite/dist/node/chunks/dep-76613303.js:30426:15
  at Array.find (<anonymous>)
  at tryNodeResolve (node_modules/vite/dist/node/chunks/dep-76613303.js:30425:44)
  at Context.resolveId (node_modules/vite/dist/node/chunks/dep-76613303.js:30257:28)

Running npx nuxi info gives the following:

- Operating System: `Darwin`
- Node Version:     `v17.0.1`
- Nuxt Version:     `3.0.0-27338323.1e98259`
- Package Manager:  `yarn@1.22.17`
- Bundler:          `Vite`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`

I get the same error on Linux with Node v14.

Any ideas ?!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 28 (6 by maintainers)

Most upvoted comments

For now, you can work around this by adding a resolution for resolve in your package.json:

{
  "private": true,
  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi build",
    "start": "node .output/server/index.mjs"
  },
  "devDependencies": {
    "nuxt3": "latest"
  },
  "resolutions": {
    "resolve": "1.20.0"
  }
}

For npm, just add resolve: 1.20.0 to your devDependencies (not overrides)

Remove it after isaacs/node-graceful-fs merges their (impossible for reason) PR.

@lewebsimple Yea, not without a silly remark from isaacs though.

I have still the same problem with the playground of Nuxt3 modules.

"resolutions": {
    "resolve": "1.20.0"
  }

This doesn’t work for me.

@SunMar resolutions only works for yarn. For npm v8, you can replace resolutions with overrides.

@danielroe what other steps are needed to make this workaround work? I am working with a brand new initialized nuxt 3 project, updated my package.json file and tried running npm update, npm install, removing package-lock.json. but I’m still experiencing the error.

For npm, just add resolve 1.20 to your dev deps (not overrides)

Cool… It works fine…

For NPM v8.x in package.json

{ "devDependencies": { "nuxt3": "latest", "resolve": "1.20.0" } }

Same problem here

For now, you can work around this by adding a resolution for resolve in your package.json:

{
  "private": true,
  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi build",
    "start": "node .output/server/index.mjs"
  },
  "devDependencies": {
    "nuxt3": "latest"
  },
  "resolutions": {
    "resolve": "1.20.0"
  }
}

This works for me, after amending my “nuxt3” to “latest” and adding the “resolutions”: { “resolve”: “1.20.0” }, I ran yarn install again and it’s working.

"resolutions": {
    "resolve": "1.20.0"
  }

It’s work for me! Thank you 😃

Works only with YARN manager - for NPM doesn’t…

"resolutions": {
    "resolve": "1.20.0"
  }

It’s work for me! Thank you 😃

i think it’s a dependecy bug … so you can copy SB Starter Package-lock.json and then try npm install or yarn install make sure your npm or yarn is the latest version. hope it works ❤️ ( this problem need an update to solve but this solution can help you … just to clarify )