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

Unable to use route().params after upgrading to 1.3.2 #441

Closed
crynobone opened this issue Jul 2, 2021 · 3 comments · Fixed by #442
Closed

Unable to use route().params after upgrading to 1.3.2 #441

crynobone opened this issue Jul 2, 2021 · 3 comments · Fixed by #442
Assignees

Comments

@crynobone
Copy link

crynobone commented Jul 2, 2021

Ziggy version

1.3.2

Laravel version

v8.49.0

Description

Unable to use route().params after upgrading to 1.3.2

image
image

image

Ziggy call and context

route().params

Ziggy configuration

{"url":"http://silver-surfer.test","port":null,"defaults":{},"routes":{"dusk.login":{"uri":"_dusk/login/{userId}/{guard?}","methods":["GET","HEAD"]},"dusk.logout":{"uri":"_dusk/logout/{guard?}","methods":["GET","HEAD"]},"dusk.user":{"uri":"_dusk/user/{guard?}","methods":["GET","HEAD"]},"nova.api.":{"uri":"nova-api/{resource}/{resourceId}/attach-morphed/{relatedResource}","methods":["POST"]},"nova.pages.login":{"uri":"nova/login","methods":["GET","HEAD"]},"nova.login":{"uri":"nova/login","methods":["POST"]},"nova.logout":{"uri":"nova/logout","methods":["POST"]},"nova.pages.password.email":{"uri":"nova/password/reset","methods":["GET","HEAD"]},"nova.password.email":{"uri":"nova/password/email","methods":["POST"]},"nova.pages.password.reset":{"uri":"nova/password/reset/{token}","methods":["GET","HEAD"]},"nova.password.reset":{"uri":"nova/password/reset","methods":["POST"]},"nova.pages.home":{"uri":"nova","methods":["GET","HEAD"]},"nova.pages.403":{"uri":"nova/403","methods":["GET","HEAD"]},"nova.pages.404":{"uri":"nova/404","methods":["GET","HEAD"]},"nova.pages.dashboard":{"uri":"nova/dashboard","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"nova.pages.dashboard.custom":{"uri":"nova/dashboards/{name}","methods":["GET","HEAD"]},"nova.pages.index":{"uri":"nova/resources/{resourceName}","methods":["GET","HEAD"]},"nova.pages.create":{"uri":"nova/resources/{resourceName}/new","methods":["GET","HEAD"]},"nova.pages.detail":{"uri":"nova/resources/{resourceName}/{resourceId}","methods":["GET","HEAD"]},"nova.pages.edit":{"uri":"nova/resources/{resourceName}/{resourceId}/edit","methods":["GET","HEAD"]},"nova.pages.replicate":{"uri":"nova/resources/{resourceName}/{resourceId}/replicate","methods":["GET","HEAD"]},"nova.pages.lens":{"uri":"nova/resources/{resourceName}/lens/{lens}","methods":["GET","HEAD"]},"nova.pages.attach":{"uri":"nova/resources/{resourceName}/{resourceId}/attach/{relatedResourceName}","methods":["GET","HEAD"]},"nova.pages.edit-attached":{"uri":"nova/resources/{resourceName}/{resourceId}/edit-attached/{relatedResourceName}/{relatedResourceId}","methods":["GET","HEAD"]},"dashboard":{"uri":"dashboard","methods":["GET","HEAD"]},"register":{"uri":"register","methods":["GET","HEAD"]},"login":{"uri":"login","methods":["GET","HEAD"]},"password.request":{"uri":"forgot-password","methods":["GET","HEAD"]},"password.email":{"uri":"forgot-password","methods":["POST"]},"password.reset":{"uri":"reset-password/{token}","methods":["GET","HEAD"]},"password.update":{"uri":"reset-password","methods":["POST"]},"verification.notice":{"uri":"verify-email","methods":["GET","HEAD"]},"verification.verify":{"uri":"verify-email/{id}/{hash}","methods":["GET","HEAD"]},"verification.send":{"uri":"email/verification-notification","methods":["POST"]},"password.confirm":{"uri":"confirm-password","methods":["GET","HEAD"]},"logout":{"uri":"logout","methods":["POST"]}}}

Route definition

Route::prefix('nova')->group(function () {
    Route::get('/{resource}', 'ResourceIndexController@handle');
});
@phattarachai
Copy link

I am having the same issue. I called route().current() and have the same error.

@bakerkretzmar
Copy link
Collaborator

bakerkretzmar commented Jul 2, 2021

Thanks, reverted the change that caused this so should be fixed in v1.3.3. I'll take a closer look tomorrow.

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

Looks like something to do with the get _location() getter not transpiling to ES5 properly, if I change it to a regular method (_location()) it seems to work fine and still get mangled.

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

Successfully merging a pull request may close this issue.

3 participants