amir9480/vscode-laravel-extra-intellisense

Title: Recurring Error in VSCode Laravel Extra Intellisense Extension

heyyoudev opened this issue · 10 comments

Description:
I recently started encountering a persistent error with this extension. This issue did not occur previously, and it appears frequently now, disrupting my workflow. Attached is a screenshot for reference.

Environment:
VSCode Version: 1.88.1
Laravel Extra Intellisense Extension Version: Last updated 2024-04-16, 08:44:11
Operating System: Ubuntu 20.04

laravel-extra-intellisense-error

Same here, I noticed this happening yesterday.

+1

screenshot_2024-04-16_17 27 06@2x

Same here

PHP Fatal error: Uncaught UnexpectedValueException: There is no existing directory at "/var/www/html/storage/logs" and it could not be created: Permission denied in /home/franche020/proyectos/proyect/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:200 Stack trace:

Similar error

2024-04-16 11:39:55.020 [info] Laravel Extra Intellisense command started: Auth Data
2024-04-16 11:39:56.308 [error] Laravel Extra Intellisense Error:
 Application Models

PHP Parse error:  Unclosed '(' in Command line code on line 1

2024-04-16 11:39:56.464 [error] Laravel Extra Intellisense Error:
 Auth Data```

@heyyoudev @tomheadifen @AMD-NICK @Franche020 @Cris123m
Hi everyone
It's a new feature to shows an error when the Laravel Extra Intellisense fails to load your application data to provide autocomplete. you may disable it for the current session using the "Don't show again" button.

In your case, looks like you have defined an App\Policies\ModelPolicy somewhere in your code but this class is not defined.

@amir9480 Thank you. I comment one line in AuthServiceProvider and it fixed mentioned problem.

Maybe you can help with another problem that started after installing this plugin. I am currently doing a project after a previous developer with whom there is no communication. After installing the plugin, I get this error in the console once per minute:

screenshot_2024-04-17_16 32 50@2x

This error appears now even after uninstalling the plugin. This function is 100% defined in only one place. On the dev server I executed docker compose pause workspace and the problem stopped. This made me think that cron is running a schedule task in artisan once a minute, but manually executing the command does not cause the error. I then reset all data in Redis and ran docker compose unpause workspace, the problem also stopped appearing. This suggests that some regular task was added to REDIS that was spamming errors to the console once a minute.

@amir9480 thank you for your response. My error was slightly different so I re-read the docs and noticed that this was happening because the base path was set incorrectly.

Thank you, @amir9480 for the prompt response. You nailed the cause. Closing this issue...

@AMD-NICK
You should define every PHP function wrapped inside a function_exists if statement.

if (! function_exists('json_success')) {
    function json_success(...)
    {
        // ...
    }
}

found it in my AuthServiceProvider.php
it was there by default I think
Just comment it out and it should work