Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lifesound's avatar

syntax error, unexpected token ">"

got tired of VSCode blade extensions tbh

I have this code


                @if (auth()->user()->isAdmin())
                    <div class="space-x-2 sm:-my-px sm:flex text-white">
                        <x-nav-link href="/shipments"
                                    class="px-2 mx-1">
                            {{ __('est.shipments') }}
                        </x-nav-link>
                    </div>
                @endif

I do not know why it is generating this err after changing the type of the file to Blade extension in VSCOde the file called navigation.blade.php

0 likes
20 replies
vincent15000's avatar

Is it a VSCode error or do you see this error displayed in the view ?

1 like
vincent15000's avatar

@lifesound So it's not related to VSCode.

Have you seen the typo error ?

{{ __('est.shipments') }}

instead of

{{ __('test.shipments') }}
tisuchi's avatar

@lifesound Your code seems correct in terms of syntax.

Can you clear your view and try again?

e.g.

php artisan view:clear
2 likes
tisuchi's avatar

@lifesound Is that the only file where you get the error or other files as well?

2 likes
lifesound's avatar

@tisuchi whole website stopped the error has many blade files without logical reason

1 like
tisuchi's avatar

@lifesound Then it's a problem in some other place.

Check error details in your laravel.log. Normally it's in storage/logs/ directory.

1 like
vincent15000's avatar

@lifesound Have you seen my previous comment ?

You have a typo error on this line.

You have written est instead of test.

JussiMannisto's avatar

You're getting a syntax error when you're trying to access a translation, so maybe the error is in your translation file. Can you show what the file looks like?

2 likes
MohamedTammam's avatar

That's not related to VS Code. It's an error in your code. You might have the file lang/en/est/shipments that returns an array or the file itself has a syntax error.

Snapey's avatar

did you touch the nav link component? It could be in there?

Please or to participate in this conversation.