Skip to content

Unable to build docs, error during prerender #513

Open
@Eazash

Description

@Eazash

🐛 The bug

When building the docs, I get the error The requested module 'file:///Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/ohash/dist/index.mjs' does not provide an export named 'diff' when prerending the / route.

Error snippet
ERROR  [request error] [unhandled] [GET] http://localhost/__nuxt_error?error=true&url=%2F&statusCode=500&statusMessage=Server+Error&message=Server+Error                      1:59:27 PM
The requested module 'file:///Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/ohash/dist/index.mjs' does not provide an export named 'diff'

    import { isEqual, diff, hash as hash$2 } from '/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/ohash/dist/index.mjs';
    ^^^^
    SyntaxError: The requested module '/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/ohash/dist/index.mjs' does not provide an export named 'diff'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:146:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:229:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at async /Users/ezra/Projects/OSS/magic-regexp/docs/.docs/.nuxt/prerender/chunks/_/renderer.mjs:117:24
    at async Object.render (/Users/ezra/Projects/OSS/magic-regexp/docs/.docs/.nuxt/prerender/chunks/_/renderer.mjs:286:64)
    at async Object.handler (/Users/ezra/Projects/OSS/magic-regexp/docs/.docs/.nuxt/prerender/chunks/nitro/nitro.mjs:1990:22)
    at async Object.handler (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:2009:19)
    at async toNodeHandle (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:2301:7)
    at async b (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/node-mock-http/dist/index.mjs:1:6808)
    at async O (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/node-mock-http/dist/index.mjs:1:7091)
    at async generateRoute (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack/dist/core/index.mjs:2111:17)
    at async Promise.all (index 1)
    at async runParallel (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack/dist/core/index.mjs:1581:3)
    at async prerender (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack/dist/core/index.mjs:2199:3)
    at async /Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._0752d1eff11e4a1164d7fde0b999e96f/node_modules/nuxt/dist/shared/nuxt.B7-cu52A.mjs:4538:5
    at async build (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]._0752d1eff11e4a1164d7fde0b999e96f/node_modules/nuxt/dist/shared/nuxt.B7-cu52A.mjs:7086:3)
    at async Object.run (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/chunks/build.mjs:91:5)
    at async Object.run (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/chunks/generate.mjs:50:5)
    at async runCommand$1 (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/shared/nuxi.VcyMLvO6.mjs:1767:16)
    at async runCommand (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/nuxi/dist/shared/nuxi.VcyMLvO6.mjs:2094:10)
    at async Object.setup (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]_patch_hash=0f882073ad4fa301216b6adbaa59bf6dd79ed2d97c27005f31b7ef5d46b55b_204abbd369f117481aa96b294f7196c5/node_modules/undocs/cli/cli.mjs:78:7)
    at async runCommand (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:288:5)
    at async runCommand (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:307:11)
    at async runMain (/Users/ezra/Projects/OSS/magic-regexp/node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:445:7)

🛠️ To reproduce

Run pnpm run generate from the docs folder (I was unable to run the project in stackblitz due to nodejs version mismatches)

🌈 Expected behaviour

The docs to be built and previewable

ℹ️ Additional context

The issue seems to be related unjs/ohash#112, where diff and other functions were moved to a utils folder. nuxt/ui@3f7df7b has updated @nuxt/ui to use the updated import paths and ohash v2. This was released in nuxt ui v2.21.1. However, since this project is currently on @nuxt/ui-pro 1.7.0 and it's still using @nuxt/ui 2.2.0

Nuxt Project Info - Operating System: `Darwin` - Node Version: `v20.18.0` - Nuxt Version: `3.16.0` - CLI Version: `3.21.1` - Nitro Version: `2.10.4` - Package Manager: `[email protected]` - Builder: `-` - User Config: `plausible` - Runtime Modules: `-` - Build Modules: `-`
`pnpm why ohash` Output
Legend: production dependency, optional only, dev only

docs /Users/ezra/Projects/OSS/magic-regexp/docs (PRIVATE)

devDependencies:
undocs 0.2.30
├─┬ @nuxt/content 2.13.4
│ ├─┬ @nuxt/kit 3.16.0
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ └── ohash 2.0.11
│ ├─┬ @nuxtjs/mdc 0.9.5
│ │ ├─┬ @nuxt/kit 3.16.0
│ │ │ ├─┬ c12 3.0.2
│ │ │ │ └── ohash 2.0.11
│ │ │ └── ohash 2.0.11
│ │ └── ohash 1.1.4
│ ├─┬ @vueuse/nuxt 11.3.0
│ │ ├─┬ @nuxt/kit 3.16.0
│ │ │ ├─┬ c12 3.0.2
│ │ │ │ └── ohash 2.0.11
│ │ │ └── ohash 2.0.11
│ │ └─┬ nuxt 3.16.0 peer
│ │   ├─┬ @nuxt/cli 3.22.5
│ │   │ ├─┬ c12 3.0.2
│ │   │ │ └── ohash 2.0.11
│ │   │ ├─┬ listhen 1.9.0
│ │   │ │ └─┬ h3 1.15.0
│ │   │ │   └── ohash 1.1.4
│ │   │ └── ohash 2.0.11
│ │   ├─┬ @nuxt/devtools 2.2.1
│ │   │ ├─┬ @nuxt/devtools-kit 2.2.1
│ │   │ │ └─┬ @nuxt/kit 3.16.0
│ │   │ │   ├─┬ c12 3.0.2
│ │   │ │   │ └── ohash 2.0.11
│ │   │ │   └── ohash 2.0.11
│ │   │ ├─┬ @nuxt/kit 3.16.0
│ │   │ │ ├─┬ c12 3.0.2
│ │   │ │ │ └── ohash 2.0.11
│ │   │ │ └── ohash 2.0.11
│ │   │ ├── ohash 2.0.11
│ │   │ └─┬ vite-plugin-inspect 11.0.0
│ │   │   ├─┬ @nuxt/kit 3.16.0 peer
│ │   │   │ ├─┬ c12 3.0.2
│ │   │   │ │ └── ohash 2.0.11
│ │   │   │ └── ohash 2.0.11
│ │   │   └── ohash 2.0.11
│ │   ├─┬ @nuxt/kit 3.16.0
│ │   │ ├─┬ c12 3.0.2
│ │   │ │ └── ohash 2.0.11
│ │   │ └── ohash 2.0.11
│ │   ├─┬ @nuxt/telemetry 2.6.5
│ │   │ └─┬ @nuxt/kit 3.16.0
│ │   │   ├─┬ c12 3.0.2
│ │   │   │ └── ohash 2.0.11
│ │   │   └── ohash 2.0.11
│ │   ├─┬ @nuxt/vite-builder 3.16.0
│ │   │ ├─┬ @nuxt/kit 3.16.0
│ │   │ │ ├─┬ c12 3.0.2
│ │   │ │ │ └── ohash 2.0.11
│ │   │ │ └── ohash 2.0.11
│ │   │ ├── ohash 2.0.11
│ │   │ └─┬ unenv 2.0.0-rc.12
│ │   │   └── ohash 2.0.11
│ │   ├─┬ c12 3.0.2
│ │   │ └── ohash 2.0.11
│ │   ├─┬ nitropack 2.11.5
│ │   │ ├─┬ c12 3.0.2
│ │   │ │ └── ohash 2.0.11
│ │   │ ├─┬ listhen 1.9.0
│ │   │ │ └─┬ h3 1.15.0
│ │   │ │   └── ohash 1.1.4
│ │   │ ├── ohash 2.0.11
│ │   │ └─┬ unenv 2.0.0-rc.12
│ │   │   └── ohash 2.0.11
│ │   ├── ohash 2.0.11
│ │   └─┬ unenv 2.0.0-rc.12
│ │     └── ohash 2.0.11
│ ├─┬ listhen 1.9.0
│ │ └─┬ h3 1.15.0
│ │   └── ohash 1.1.4
│ ├── ohash 1.1.4
│ └─┬ unstorage 1.14.4
│   └─┬ h3 1.15.0
│     └── ohash 1.1.4
├─┬ @nuxt/fonts 0.10.3
│ ├─┬ @nuxt/devtools-kit 1.7.0
│ │ └─┬ @nuxt/kit 3.16.0
│ │   ├─┬ c12 3.0.2
│ │   │ └── ohash 2.0.11
│ │   └── ohash 2.0.11
│ ├─┬ @nuxt/kit 3.16.0
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ └── ohash 2.0.11
│ ├─┬ h3 1.15.0
│ │ └── ohash 1.1.4
│ ├── ohash 1.1.4
│ ├─┬ unifont 0.1.7
│ │ └── ohash 1.1.4
│ └─┬ unstorage 1.14.4
│   └─┬ h3 1.15.0
│     └── ohash 1.1.4
├─┬ @nuxt/ui-pro 1.7.0
│ └─┬ @nuxt/ui 2.21.0
│   ├─┬ @nuxt/icon 1.10.3
│   │ ├─┬ @nuxt/devtools-kit 1.7.0
│   │ │ └─┬ @nuxt/kit 3.16.0
│   │ │   ├─┬ c12 3.0.2
│   │ │   │ └── ohash 2.0.11
│   │ │   └── ohash 2.0.11
│   │ ├─┬ @nuxt/kit 3.16.0
│   │ │ ├─┬ c12 3.0.2
│   │ │ │ └── ohash 2.0.11
│   │ │ └── ohash 2.0.11
│   │ └── ohash 1.1.4
│   ├─┬ @nuxt/kit 3.16.0
│   │ ├─┬ c12 3.0.2
│   │ │ └── ohash 2.0.11
│   │ └── ohash 2.0.11
│   ├─┬ @nuxtjs/color-mode 3.5.2
│   │ └─┬ @nuxt/kit 3.16.0
│   │   ├─┬ c12 3.0.2
│   │   │ └── ohash 2.0.11
│   │   └── ohash 2.0.11
│   ├─┬ @nuxtjs/tailwindcss 6.13.1
│   │ ├─┬ @nuxt/kit 3.16.0
│   │ │ ├─┬ c12 3.0.2
│   │ │ │ └── ohash 2.0.11
│   │ │ └── ohash 2.0.11
│   │ ├─┬ c12 2.0.1
│   │ │ ├─┬ giget 1.2.4
│   │ │ │ └── ohash 1.1.4
│   │ │ └── ohash 1.1.4
│   │ └─┬ h3 1.15.0
│   │   └── ohash 1.1.4
│   └── ohash 1.1.4
├─┬ @nuxtjs/plausible 1.2.0
│ └─┬ @nuxt/kit 3.16.0
│   ├─┬ c12 3.0.2
│   │ └── ohash 2.0.11
│   └── ohash 2.0.11
├─┬ @nuxtjs/tailwindcss 6.13.1
│ ├─┬ @nuxt/kit 3.16.0
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ └── ohash 2.0.11
│ ├─┬ c12 2.0.1
│ │ ├─┬ giget 1.2.4
│ │ │ └── ohash 1.1.4
│ │ └── ohash 1.1.4
│ └─┬ h3 1.15.0
│   └── ohash 1.1.4
├─┬ automd 0.3.12
│ └─┬ c12 2.0.1
│   ├─┬ giget 1.2.4
│   │ └── ohash 1.1.4
│   └── ohash 1.1.4
├─┬ c12 2.0.1
│ ├─┬ giget 1.2.4
│ │ └── ohash 1.1.4
│ └── ohash 1.1.4
├─┬ nitropack 2.10.4
│ ├─┬ c12 2.0.1
│ │ ├─┬ giget 1.2.4
│ │ │ └── ohash 1.1.4
│ │ └── ohash 1.1.4
│ ├─┬ h3 1.15.0
│ │ └── ohash 1.1.4
│ ├─┬ listhen 1.9.0
│ │ └─┬ h3 1.15.0
│ │   └── ohash 1.1.4
│ ├── ohash 1.1.4
│ └─┬ unstorage 1.14.4
│   └─┬ h3 1.15.0
│     └── ohash 1.1.4
├─┬ nuxt 3.16.0
│ ├─┬ @nuxt/cli 3.22.5
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ ├─┬ listhen 1.9.0
│ │ │ └─┬ h3 1.15.0
│ │ │   └── ohash 1.1.4
│ │ └── ohash 2.0.11
│ ├─┬ @nuxt/devtools 2.2.1
│ │ ├─┬ @nuxt/devtools-kit 2.2.1
│ │ │ └─┬ @nuxt/kit 3.16.0
│ │ │   ├─┬ c12 3.0.2
│ │ │   │ └── ohash 2.0.11
│ │ │   └── ohash 2.0.11
│ │ ├─┬ @nuxt/kit 3.16.0
│ │ │ ├─┬ c12 3.0.2
│ │ │ │ └── ohash 2.0.11
│ │ │ └── ohash 2.0.11
│ │ ├── ohash 2.0.11
│ │ └─┬ vite-plugin-inspect 11.0.0
│ │   ├─┬ @nuxt/kit 3.16.0 peer
│ │   │ ├─┬ c12 3.0.2
│ │   │ │ └── ohash 2.0.11
│ │   │ └── ohash 2.0.11
│ │   └── ohash 2.0.11
│ ├─┬ @nuxt/kit 3.16.0
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ └── ohash 2.0.11
│ ├─┬ @nuxt/telemetry 2.6.5
│ │ └─┬ @nuxt/kit 3.16.0
│ │   ├─┬ c12 3.0.2
│ │   │ └── ohash 2.0.11
│ │   └── ohash 2.0.11
│ ├─┬ @nuxt/vite-builder 3.16.0
│ │ ├─┬ @nuxt/kit 3.16.0
│ │ │ ├─┬ c12 3.0.2
│ │ │ │ └── ohash 2.0.11
│ │ │ └── ohash 2.0.11
│ │ ├── ohash 2.0.11
│ │ └─┬ unenv 2.0.0-rc.12
│ │   └── ohash 2.0.11
│ ├─┬ c12 3.0.2
│ │ └── ohash 2.0.11
│ ├─┬ nitropack 2.11.5
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ ├─┬ listhen 1.9.0
│ │ │ └─┬ h3 1.15.0
│ │ │   └── ohash 1.1.4
│ │ ├── ohash 2.0.11
│ │ └─┬ unenv 2.0.0-rc.12
│ │   └── ohash 2.0.11
│ ├── ohash 2.0.11
│ └─┬ unenv 2.0.0-rc.12
│   └── ohash 2.0.11
├─┬ nuxt-build-cache 0.1.1
│ ├─┬ @nuxt/kit 3.16.0
│ │ ├─┬ c12 3.0.2
│ │ │ └── ohash 2.0.11
│ │ └── ohash 2.0.11
│ └── ohash 1.1.4
└─┬ unstorage 1.14.4
  └─┬ h3 1.15.0
    └── ohash 1.1.4

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions