Skip to content

Commit d8b9d4e

Browse files
committed
fix(tests): fix tests ; cannot import utils from server context
1 parent 2574ad8 commit d8b9d4e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/runtime/server/api/highlight.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { createError, defineLazyEventHandler, useBody } from 'h3'
22
import { getHighlighter, BUNDLED_LANGUAGES, BUNDLED_THEMES, Lang, Theme } from 'shiki-es'
3+
import { useLogger } from '@nuxt/kit'
34
import { HighlightParams, HighlightThemedToken } from '../../types'
45
import mdcTMLanguage from '../../assets/mdc.tmLanguage.json'
5-
import { logger } from '../../../utils'
66
import { useRuntimeConfig } from '#imports'
77

8+
// Re-create logger locally as utils cannot be imported from here
9+
export const logger = useLogger('@nuxt/content')
10+
811
/**
912
* Resolve Shiki compatible lang from string.
1013
*

src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { ModuleOptions, MountOptions } from './module'
99
import type { MarkdownPlugin } from './runtime/types'
1010

1111
export const logger = useLogger('@nuxt/content')
12+
1213
/**
1314
* Internal version that represents cache format.
1415
* This is used to invalidate cache when the format changes.

0 commit comments

Comments
 (0)