When I added the nuxt-content-twoslash module to a new project generated from the github:nuxt-ui-pro/docs template, I encountered this error:
ERROR This module cannot be imported in server runtime. [importing @nuxt/kit from ../node_modules/.pnpm/@nuxtjs+mdc@0.8.2_rollup@3.29.4/node_modules/@nuxtjs/mdc/dist/config.mjs] 8:07:31 AM
[8:07:31 AM] ERROR This module cannot be imported in server runtime. [importing ../node_modules/.pnpm/@nuxt+kit@3.12.2_rollup@3.29.4/node_modules/@nuxt/kit/dist/index.mjs from ../node_modules/.pnpm/@nuxtjs+mdc@0.8.2_rollup@3.29.4/node_modules/@nuxtjs/mdc/dist/module.mjs]
ℹ Vite client warmed up in 1282ms 8:07:31 AM
✔ Nitro built in 935 ms nitro 8:07:31 AM
[8:07:32 AM] ERROR [worker reload] [worker init] The requested module 'file:///Users/wouter/git/wpnuxt/nuxt-content-twoslash/node_modules/.pnpm/unenv@1.9.0/node_modules/unenv/runtime/mock/proxy.cjs' does not provide an export named 'addComponent'
import { defineNuxtModule, createResolver, addServerHandler, addComponent, addImports, addServerImports, addComponentsDir, hasNuxtModule, extendViteConfig, useNitro, addTemplate } from 'node_modules/.pnpm/unenv@1.9.0/node_modules/unenv/runtime/mock/proxy.cjs';
^^^^^^^^^^^^
SyntaxError: The requested module 'node_modules/.pnpm/unenv@1.9.0/node_modules/unenv/runtime/mock/proxy.cjs' does not provide an export named 'addComponent'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
I found out that the module still works with @nuxtjs/mdc@0.8.1, but breaks when using @nuxtjs/mdc@0.8.2.
For the reproduction I updated @nuxtjs/mdc to version 0.8.2 in the playground of the module repo, which triggers the error.
Describe the bug
When I added the nuxt-content-twoslash module to a new project generated from the github:nuxt-ui-pro/docs template, I encountered this error:
I found out that the module still works with @nuxtjs/mdc@0.8.1, but breaks when using @nuxtjs/mdc@0.8.2.
For the reproduction I updated @nuxtjs/mdc to version 0.8.2 in the playground of the module repo, which triggers the error.
Reproduction
https://stackblitz.com/~/github.com/vernaillen/nuxt-content-twoslash
System Info
Used Package Manager
pnpm
Validations
Contributions