PHP/Phalcon Error: Closed without sending a request; it was probably just an unused speculative preconnection ← (PHP, Laravel, Phalcon)

I have a basic controller action:

    public function createAction() {
        $this->view->disable();

        $formData = $this->request->getJsonRawBody();

        $user = new Users();

        $user->first_name = $formData->first_name;
        $user->last_name = $formData->last_name;
        $user->email_address = $formData->email_address;
        $user->password = $formData->password;

        // this prints to my debug log.
        $result = $user->save(); 
        AppLogger::$logger->debug(print_r($result, true)); // this does not print.
        AppLogger::$logger->debug("oh boy #2"); // this does not print either.
        // which seems to tell me that the line above it is problematic,
        // but there is no error output from `phalcon serve`

        echo Json::encode($result);
    }

The closest thing I see to an error is this: PHP/Phalcon Error: Closed without sending a request; it was probably just an unused speculative preconnection. This is appearing in the output of phalcon serve.

I'm running phalcon serve in VSCode on Windows.

Answer



Solution:

I fixed this by wrapping $result = $user->save(); in a try/catch, then I was able to see the exception.

It seems that this exception is not automatically displayed in the terminal output...

Answer



Solution:

Had the same issue when a user tries to log out, restarted my server(laravel inbuilt server)and it worked like a charm.

Answer



Solution:

If you're cloning a Laravel project, make sure your .env file is created. They have sensitive information and may be kept inside .gitignore.

Source