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

Trying to access array offset on value of type null #136

Open
theara72 opened this issue Dec 22, 2021 · 4 comments
Open

Trying to access array offset on value of type null #136

theara72 opened this issue Dec 22, 2021 · 4 comments

Comments

@theara72
Copy link

theara72 commented Dec 22, 2021

I come across this error such as below

php : v8.0.3 with opcache and xdebug
laravel : v8 LTS

note: eror occure while pre-compile commanding

sorry for bad english

Trying to access array offset on value of type null

  at C:\xampp_old\htdocs\nib-backend-v2\vendor\laravel\framework\src\Illuminate\Http\Client\Response.php:349
    345▕      */
    346▕     #[\ReturnTypeWillChange]
    347▕     public function offsetGet($offset)
    348▕     {
  ➜ 349▕         return $this->json()[$offset];
    350▕     }
    351▕
    352▕     /**
    353▕      * Set the value at the given offset.

  1   C:\xampp_old\htdocs\nib-backend-v2\vendor\laravel\framework\src\Illuminate\Http\Client\Response.php:349
      Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Trying to access array offset on value of type null", "C:\xampp_old\htdocs\nib-backend-v2\vendor\laravel\framework\src\Illuminate\Http\Client\Response.php")

  2   C:\xampp_old\htdocs\nib-backend-v2\vendor\appstract\laravel-opcache\src\Commands\Compile.php:40
      Illuminate\Http\Client\Response::offsetGet("result")
@m0stwan1ed
Copy link

Same error:
image

@tormit
Copy link

tormit commented Jan 21, 2022

This project looks dead. Are there any forks with latest patches?

@Stunext
Copy link

Stunext commented Feb 18, 2022

I have seen that many have problems with the Http facade. You could try using the exclude array in the opcache.php file in the config folder, although I don't know if this array allows you to indicate the path to an entire folder to exclude. I should clarify that I have not had that problem in both laravel 8 and laravel 9.

In general, when the library has failed me, it is when I try to add it to an already advanced project. Sometimes I create a clean Laravel project and then I add little by little the code of the base project until I detect where the file that cannot be compiled is.

@LocalHeroPro
Copy link

I have similar issue:

$ php artisan opcache:compile --force --env=testing
Compiling scripts...

In Response.php line 361:

  Trying to access array offset on value of type null

I think it's pointing to: Illuminate\Http\Client\Response@offsetGet
image

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

No branches or pull requests

5 participants