Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/flat-steaks-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: prevent type errors when optional `@opentelemetry/api` dependency isn't installed
4 changes: 3 additions & 1 deletion packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ import {
LayoutParams as AppLayoutParams,
ResolvedPathname
} from '$app/types';
import { Span } from '@opentelemetry/api';

export { PrerenderOption } from '../types/private.js';

// @ts-ignore this is an optional peer dependency so could be missing. Written like this so dts-buddy preserves the ts-ignore
type Span = import('@opentelemetry/api').Span;

/**
* [Adapters](https://svelte.dev/docs/kit/adapters) are responsible for taking the production build and turning it into something that can be deployed to a platform of your choosing.
*/
Expand Down
4 changes: 3 additions & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ declare module '@sveltejs/kit' {
import type { SvelteConfig } from '@sveltejs/vite-plugin-svelte';
import type { StandardSchemaV1 } from '@standard-schema/spec';
import type { RouteId as AppRouteId, LayoutParams as AppLayoutParams, ResolvedPathname } from '$app/types';
import type { Span } from '@opentelemetry/api';
// @ts-ignore this is an optional peer dependency so could be missing. Written like this so dts-buddy preserves the ts-ignore
type Span = import('@opentelemetry/api').Span;

/**
* [Adapters](https://svelte.dev/docs/kit/adapters) are responsible for taking the production build and turning it into something that can be deployed to a platform of your choosing.
*/
Expand Down
Loading