Skip to content
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

Swoole server not load ziggy-js, Ziggy is not defined error appears. #443

Closed
medyun opened this issue Jul 13, 2021 · 2 comments
Closed

Swoole server not load ziggy-js, Ziggy is not defined error appears. #443

medyun opened this issue Jul 13, 2021 · 2 comments
Assignees

Comments

@medyun
Copy link

medyun commented Jul 13, 2021

Ziggy version

1.3.4

Laravel version

5.7.29

Description

I'm trying to run my project with swoole, but I'm getting an error in ziggy js. It works fine for the first couple of requests, but then it starts giving the following error.

image

Ziggy call and context

I added @routes declaration into blade.php

Ziggy configuration

When i run console.log(Ziggy), error "Uncaught ReferenceError: Ziggy is not defined" appears.

Route definition

The error is not related to the route definitions.
@bakerkretzmar
Copy link
Collaborator

Are you using Octane?

@bakerkretzmar bakerkretzmar self-assigned this Jul 15, 2021
@bakerkretzmar
Copy link
Collaborator

Ah never mind, just saw you're on Laravel 5.7. You'll need to reset the internal 'generated' state at the beginning of each request. Take a look at #415 to see how we're doing that for Octane—it should be as simple as BladeRouteGenerator::$generated = false; at the very beginning of each new request cycle. Let me know if that works for you!

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

No branches or pull requests

2 participants