diff --git a/src/options.ts b/src/options.ts index fa07990b78..77e48264fc 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1,4 +1,4 @@ -import { resolve } from 'pathe' +import { join, resolve } from 'pathe' import { loadConfig } from 'c12' import { klona } from 'klona/full' import { camelCase } from 'scule' @@ -54,7 +54,8 @@ const NitroDefaults: NitroConfig = { // Rollup alias: { - '#nitro': runtimeDir + '#nitro': runtimeDir, + '#nitro-error': join(runtimeDir, 'error') }, unenv: {}, analyze: false, diff --git a/src/rollup/config.ts b/src/rollup/config.ts index e71c320f13..61586f0b37 100644 --- a/src/rollup/config.ts +++ b/src/rollup/config.ts @@ -230,7 +230,6 @@ export const plugins = [ } rollupConfig.plugins.push(alias({ entries: resolveAliases({ - '#nitro': runtimeDir, '#build': buildDir, '~': nitro.options.srcDir, '@/': nitro.options.srcDir, diff --git a/src/runtime/app.ts b/src/runtime/app.ts index 66b3cd8cef..c0aff52236 100644 --- a/src/runtime/app.ts +++ b/src/runtime/app.ts @@ -8,7 +8,7 @@ import { useRuntimeConfig } from './config' import { timingMiddleware } from './timing' import { cachedEventHandler } from './cache' import { plugins } from '#nitro/virtual/plugins' -import handleError from '#nitro/error' +import handleError from '#nitro-error' import { handlers } from '#nitro/virtual/server-handlers' export interface NitroApp { diff --git a/tsconfig.json b/tsconfig.json index 79ac219376..65fc037363 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,9 @@ "#nitro/*": [ "./src/runtime/*" ], + "#nitro-error": [ + "./src/runtime/error" + ], }, } }