question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

syntax error with @include

See original GitHub issue

Laravel 9, PHP 8.1 #502 introduced a bug

@include('livewire.cx.equipment-list-internal.account', ['account' => $account]) has been formatted as

@include(
    'livewire.cx.equipment-list-internal.account', 
    ['account' => $account],
)

notice the last comma after ] and this throws syntax error, unexpected token ",", expecting ")"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
shufocommented, Mar 3, 2022
0reactions
shufocommented, Mar 7, 2022

@mrtawil Thanks, I’m glad you started like Blade’s coding!

By the way, in my environment, the following code which contains newlines does not seem to cause an Exception.

@include(
    'adminro.dashboard.datatables.datatable_forms',
    ['controllerSettings' => $controllerSettings, 'dataTable' => $dataTable]
)

Can you provide minimum reproduceable repository or something? Or a screenshot or screencast reproducing the situation would be appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syntax error trying to execute #include statement
The #include statement can only be run as part of a program. If you try to run an #include statement from the command-line...
Read more >
Include, Require a syntax error file - php
I would like to ask can I require/include a file that has syntax errors and if I cant, the require/include returns a value...
Read more >
Syntax error in Include Programs
Hi Group, created an include.While syntax check i got the error saying REPORT/PROGRAM statment mising or program type is I(INCLUDE).
Read more >
%include ERROR - SAS Support Communities
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error. 4664 %include "&path.Plot Workbook.sas" ;;
Read more >
Include error - General Usage
Hi, I am having the same issue, using Julia 1.7. No matter the file, the include always throw the vector syntax error. Any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found