how to get it works with "laravel inertia vue stack" ? #123
-
i'm using vue with inertia and laravel ..i installed the vite plugin ...opened the devtools url ..it only show wating for connection |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 13 replies
-
You can try |
Beta Was this translation helpful? Give feedback.
-
I'm also trying to get this to work, what I've tried is this config: export default defineConfig({
plugins: [
VueDevTools({
appendTo: 'resources/scripts/main.ts',
clientHost: 'https://my-app.test:5173',
}),
laravel({
input: 'resources/scripts/main.ts',
}),
]
}) I'm getting somewhere, except the CSS and JS (ex. Tried setting |
Beta Was this translation helpful? Give feedback.
-
i've tried this change locally, and while it does get the dev tools loading started, it still has an error because of the different domains between the Laravel app host and the Vite host.
|
Beta Was this translation helpful? Give feedback.
-
I think the issue is that the parent doesn't match the domain of the vite server, so when the postMessage command runs there's an error. This is handled in
needs to run postMessage to the domain of the browser, so it should be...
I was trying to link to this package locally, but I'm having trouble running it for some reason to test this. I edited the minified source from the downloaded plugin and it does resolve the error, though the actual iframe with the tool is still stuck loading. |
Beta Was this translation helpful? Give feedback.
-
If anyone can help with this, when I
|
Beta Was this translation helpful? Give feedback.
-
I think with this change the message is being posted to the browser instead of the iframe we need it posted to, which is why nothing is happening. I'm trying to forward the message back to the iframe by adding a listener on the window and then using Also, I think the message post can be |
Beta Was this translation helpful? Give feedback.
-
This works successfully with stand-alone mode and is a way we can try it out until we have a solution for the nicer integration. You can add the <script> tag to your
or add it to your
Since this isn't a smooth as the installation we'd like to use (and I definitely want to get that working still) you may want to add a script to your package.json to make launching the dev tools easier, and so you don't forget about them.
|
Beta Was this translation helpful? Give feedback.
-
I have this working with Laravel, Inertia, and Vue. Here's the configuration: in your import VueDevTools from 'vite-plugin-vue-devtools'
...
...
...
export default defineConfig({
plugins: [
VueDevTools({
appendTo: 'app.ts',
openInEditorHost: 'https://my-app.test:5173',
clientHost: 'https://my-app.test:5173',
}),
...
...
...
}) You need to make sure the clientHost attribute matches where you have vite running and your CSS/JS are being loaded from. If you have multiple apps running at a time vite may load on a different port, or it'll run on a different port if you've specified it in your server configuration. I'm not happy needing to hardcode the port and protocol in there like that. I would like to see it use the |
Beta Was this translation helpful? Give feedback.
-
It will be fixed by #335 and only needs to be configured with the |
Beta Was this translation helpful? Give feedback.
-
This is available now, and appears to work well. The only config you need is: plugins: [
VueDevTools({
appendTo: "app.ts",
}),
...
...
], It seems the separate window option at |
Beta Was this translation helpful? Give feedback.
This is available now, and appears to work well. The only config you need is:
It seems the separate window option at
https://my-host.test:5173/__devtools__/
isn't yet functional, but this is still significantly better.