-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
Description
Extension Version
1.2.1
PHP Binary
Docker
Operating System
Linux
What happened?
2025-11-12 15:40:33.648 [info] Activating Laravel Extension...
2025-11-12 15:40:33.648 [info] Started
2025-11-12 15:40:39.023 [error] /bin/sh: 104: Syntax error: ")" unexpected
2025-11-12 15:41:13.064 [error] /bin/sh: 262: Syntax error: ")" unexpected
The error is triggered the first time (of VS Code session) I open either of these files:
app/helpers.phpvendor/_laravel_ide/discover-<hash>.php(only one of them)
This is obviously not a file I would normally open, but I found out during debugging.
I noticed that the error line /bin/sh: <line_no> comports to similar code in both PHP files:
-
Line
104ofvendor/_laravel_ide/discover-<hash>.php:return str($modelProperty->getValue($provider))->prepend("\\")->toString();
-
Line
262ofapp/helpers.php:$className = trim($target, "\\");
So, I expect the problem is related to "\\" in the PHP file not working well with /bin/sh, presumably something is escaping incorrectly...?
Anyway, for app/helpers.php, replacing "\\" with '\\', fixes the issue.
PS: Not sure what OS to pick; I run Laravel using Docker on Ubuntu on WSL2 (not Docker Desktop).
Mimimal Code Sample
$foo = trim($bar, "\\");