Skip to content

Commit

Permalink
fix(astro): Correct typing for #async-local-storage (#4998)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekradko authored Jan 24, 2025
1 parent 9bafaf5 commit 58441a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .changeset/giant-needles-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 6 additions & 0 deletions packages/astro/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;

declare module '#async-local-storage' {
import type { AsyncLocalStorage } from 'node:async_hooks';

export const authAsyncStorage: AsyncLocalStorage<unknown>;
}
1 change: 0 additions & 1 deletion packages/astro/src/react/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type {
import type { Store, StoreValue } from 'nanostores';
import { useCallback, useSyncExternalStore } from 'react';

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

import { $authStore } from '../stores/external';
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/server/clerk-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { eventMethodCalled } from '@clerk/shared/telemetry';
import { handleValueOrFn } from '@clerk/shared/utils';
import type { APIContext } from 'astro';

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

import { NETLIFY_CACHE_BUST_PARAM } from '../internal';
Expand Down

0 comments on commit 58441a5

Please sign in to comment.