tighten / ziggy

Use your Laravel routes in JavaScript.
MIT License
3.83k stars 247 forks source link

Generated types don't match generated routes when using Vue #701

Closed pindab0ter closed 7 months ago

pindab0ter commented 7 months ago

Ziggy version

1.8.1

Laravel version

10.39.0

Description

When you run php artisan ziggy:generate --types, two files are generated:

resources/js/ziggy.js, which exports the Ziggy object. resources/js/ziggy.d.ts, which defines the RouteList interface in the ziggy-js namespace.

Now in my app.ts file on the line where I import Ziggy (import { Ziggy } from './ziggy';) it says TS2305: Module './ziggy' has no exported member Ziggy. This is—for as far as I understand—because ziggy.d.ts's definitions differ from the contents of ziggy.js.

Ziggy call and context

n/a

Ziggy configuration

n/a

Route definition

n/a