ziggy icon indicating copy to clipboard operation
ziggy copied to clipboard

TypeScript: `Module ... has no exported member Ziggy`

Open Livijn opened this issue 9 months ago • 2 comments

Ziggy version

2.5.2

Laravel version

12

Description

I generate my routes and types. When I import the routes config in typescript the TS service throws an error:

Module "@/lib/ziggy" has no exported member Ziggy

It makes sense because the ziggy.d.ts doesn't export anything except export {}; (to make it a module).

Ziggy call and context

Not relevant

Ziggy configuration

Not relevant

Route definition

Not relevant

Livijn avatar Mar 21 '25 15:03 Livijn

I think this PR #826 was created to fix this but there is a better solution here that doesn't require a name option: #829

Livijn avatar Mar 21 '25 15:03 Livijn

What is your @/lib/ziggy file and what's in it? How are you importing it and where are you generating and storing Ziggy's actual script and the types file?

bakerkretzmar avatar May 17 '25 17:05 bakerkretzmar