Skip to content

Allow specifying the name of the typescript declaration file#872

Merged
bakerkretzmar merged 1 commit into2.xfrom
dts-escape-hatch
Feb 16, 2026
Merged

Allow specifying the name of the typescript declaration file#872
bakerkretzmar merged 1 commit into2.xfrom
dts-escape-hatch

Conversation

@bakerkretzmar
Copy link
Collaborator

Allows passing a value to the --types command option to put the types at a custom path instead of resources/js/ziggy.d.ts. This is a bandaid solution for the 'module has no exported member Ziggy' issue, which I believe really does just boil down to the files being named the same, which they shouldn't be. I think changing the default name is a breaking change though, so adding this in the meantime.

To fix the issue described in #828, #829, and #826, use --types=resources/js/ziggy-routes.d.ts in your commands (or another path that is not resources/js/ziggy.d.ts).

The default in the command signature is "false" to remain compatible with existing command usage that either:

  • doesn't pass the --types option at all (in which case the command will now see "false" and not generate types)
  • passes --types just like that, with no value (in which case the command will see it as null and generate types at the default location)

Closes #828.

@bakerkretzmar bakerkretzmar force-pushed the dts-escape-hatch branch 5 times, most recently from 04d1473 to 98ebaea Compare February 16, 2026 19:26
@bakerkretzmar bakerkretzmar merged commit ada585b into 2.x Feb 16, 2026
26 checks passed
@bakerkretzmar bakerkretzmar deleted the dts-escape-hatch branch February 16, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript: Module ... has no exported member Ziggy

1 participant