Replies: 1 comment 1 reply
-
Looking at #692, that solution seems to work for me, but I think really what I need to do is build the ziggy js from the source inside |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using direct
webpack
, novite
ormix
.I've installed the
tightenco/ziggy
composer package and theziggy-js
npm package. I've generated the js and .d.ts file viaphp artisan ziggy:generate --types
. Both live inresources/js/
. I've added an entry inplugins
fornew webpack.ProvidePlugin({ route: 'ziggy-js' })
. I've updatedtsconfig.json
to include atypeRoots
entry for./resources/js
and added apaths
entry for"ziggy-js": ["./vendor/tightenco/ziggy"]
.If I add an
import { Ziggy } from '../resources/js/ziggy.js';
to myapp.tsx
file, typescript complains becauseTS2305: Module '"../resources/js/ziggy.js"' has no exported member 'Ziggy'.
Obviously,
resources/js/ziggy.js
has an exportedZiggy
, but theresources/js/ziggy.d.ts
file doesn't, which is where I assume it's trying to get its types.I feel like I have to be missing something. Can anyone assist?
Beta Was this translation helpful? Give feedback.
All reactions