Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export default defineNuxtModule<ModuleOptions>({

nuxt.options.nitro.virtual ||= {}
nuxt.options.nitro.virtual['#nuxt-icon-server-runtime'] = usesNitroV3
? `export { defineCachedHandler } from 'nitro/cache'`
: `export { defineCachedEventHandler as defineCachedHandler } from 'nitropack/runtime'`
? `export { defineCachedHandler } from 'nitro/cache'\nexport { createError } from 'nitro/h3'`
: `export { defineCachedEventHandler as defineCachedHandler } from 'nitropack/runtime'\nexport { createError } from 'h3'`
nuxt.options.nitro.virtual['#nuxt-icon-server-options'] = () =>
`export default ${JSON.stringify({
iconifyApiEndpoint: options.iconifyApiEndpoint,
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/server/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getIcons } from '@iconify/utils'
import { hash } from 'ohash'
import { createError, type H3Event } from 'h3'
import type { H3Event } from 'h3'
import { parseQuery, parsePath } from 'ufo'
import { consola } from 'consola'
import options from '#nuxt-icon-server-options'
import { defineCachedHandler } from '#nuxt-icon-server-runtime'
import { createError, defineCachedHandler } from '#nuxt-icon-server-runtime'
import { collections } from '#nuxt-icon-server-bundle'

const warnOnceSet = /* @__PURE__ */ new Set<string>()
Expand Down
2 changes: 2 additions & 0 deletions src/shim.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ declare module '#nuxt-icon-server-options' {

declare module '#nuxt-icon-server-runtime' {
import type { defineCachedEventHandler } from 'nitropack/runtime'
import type { createError as _createError } from 'h3'

export const defineCachedHandler: typeof defineCachedEventHandler
export const createError: typeof _createError
}
Loading