Skip to content

Commit

Permalink
fix: Proper importing of defaultImport
Browse files Browse the repository at this point in the history
  • Loading branch information
kulla committed Dec 7, 2023
1 parent 93fb52e commit 0901a3d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/server/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ export async function useDefaultImport<A>(value: A): Promise<A> {

// Since `default-import` is a ESM only library do not import it statically
// because otherwise we would get an error in CommonJS runtime mode.
const { default: defaultImport } = await import('default-import')
const { defaultImport } = await import('default-import')

// @ts-expect-error The types do not really match with the dynamic import ->
// Let's ignore this error for now...
return defaultImport(value) as A
}

0 comments on commit 0901a3d

Please sign in to comment.