-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"route is not defined" from SSR server #670
Comments
I found a workaround by doing this in every component I need routes: import {route as ziggyRoute} from "ziggy-js";
const route = inject<typeof ziggyRoute>("route")!; |
Hi, I have this problem too. I use Inertia Laravel + Inertia/Svelte. Here's the issue I create in my repository: senkulabs/breeze-lite#4. I don't setup any route in my Svelte components. I just use |
+1, same issue, but with Jetstream. I will try the workaround, but I think it's a bug. Probably will be fixed with Inertia 2.0? |
I run into this myself with Jetstream as well, but only intermittently. |
It turns out that I need to explicitly tell the vite the exact location of Ziggy's route in - import { route } from 'ziggy-js';
+ import { route } from '../../vendor/tightenco/ziggy'; |
I have the same issue with Laravel + inertia + vue |
I try this, but I got new error: |
+1 i have the same issues.... Route is not defined only in ssr |
I'm not quite sure where to put this.
I just verified that its not just my app.
I installed a fresh Laravel project with Laravel Breeze using Vue with Inertia, Inertia SSR and TypeScript.
Then I added a
console.log(route('profile'))
in my Welcome.vue files<script setup>
section. compiled everything withnpm run build
, started the ssr server withphp artisan inertia:start-ssr
, disabled JavaScript in my browser and reload the page.The result is always the same:
It's always
ReferenceError: route is not defined
.That's the problem I have in my application too. With JavaScript running from the browser: No problems at all. Everything works fine.
But without JavaScript, so it definitely comes from the SSR server:
route is not defined
.I'm a litte overwhelmed with this... Someone any ideas?
The text was updated successfully, but these errors were encountered: