Skip to content

Commit 58441a5

Browse files
authored
fix(astro): Correct typing for #async-local-storage (#4998)
1 parent 9bafaf5 commit 58441a5

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.changeset/giant-needles-bathe.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/astro/src/global.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
declare const PACKAGE_NAME: string;
22
declare const PACKAGE_VERSION: string;
3+
4+
declare module '#async-local-storage' {
5+
import type { AsyncLocalStorage } from 'node:async_hooks';
6+
7+
export const authAsyncStorage: AsyncLocalStorage<unknown>;
8+
}

packages/astro/src/react/hooks.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type {
99
import type { Store, StoreValue } from 'nanostores';
1010
import { useCallback, useSyncExternalStore } from 'react';
1111

12-
// @ts-expect-error - TS2307: Cannot find module '#async-local-storage'.
1312
import { authAsyncStorage } from '#async-local-storage';
1413

1514
import { $authStore } from '../stores/external';

packages/astro/src/server/clerk-middleware.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { eventMethodCalled } from '@clerk/shared/telemetry';
77
import { handleValueOrFn } from '@clerk/shared/utils';
88
import type { APIContext } from 'astro';
99

10-
// @ts-ignore
1110
import { authAsyncStorage } from '#async-local-storage';
1211

1312
import { NETLIFY_CACHE_BUST_PARAM } from '../internal';

0 commit comments

Comments
 (0)