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

Exception when using anonymous component #118

Closed
punyflash opened this issue Oct 9, 2024 · 2 comments
Closed

Exception when using anonymous component #118

punyflash opened this issue Oct 9, 2024 · 2 comments

Comments

@punyflash
Copy link

Volt Version

1.6.5

Laravel Version

11.27.2

PHP Version

8.3.12

Database Driver & Version

No response

Description

When navigating between pages using back/front browser buttons, sometimes I get an exception:

[2024-10-09 22:46:33] local.ERROR: Livewire\Volt\FragmentAlias::encode(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/vendor/livewire/volt/src/Precompilers/ExtractFragments.php on line 98 {"userId":1,"exception":"[object] (TypeError(code: 0): Livewire\\Volt\\FragmentAlias::encode(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/vendor/livewire/volt/src/Precompilers/ExtractFragments.php on line 98 at /var/www/html/vendor/livewire/volt/src/FragmentAlias.php:15)
[stacktrace]
#0 /var/www/html/vendor/livewire/volt/src/Precompilers/ExtractFragments.php(98): Livewire\\Volt\\FragmentAlias::encode()
#1 /var/www/html/vendor/livewire/volt/src/Precompilers/ExtractFragments.php(50): Livewire\\Volt\\Precompilers\\ExtractFragments->directive()
#2 [internal function]: Livewire\\Volt\\Precompilers\\ExtractFragments->Livewire\\Volt\\Precompilers\\{closure}()
#3 /var/www/html/vendor/livewire/volt/src/Precompilers/ExtractFragments.php(38): preg_replace_callback()
#4 /var/www/html/vendor/livewire/volt/src/VoltServiceProvider.php(44): Livewire\\Volt\\Precompilers\\ExtractFragments->__invoke()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(262): Livewire\\Volt\\VoltServiceProvider->Livewire\\Volt\\{closure}()
#6 /var/www/html/vendor/imanghafoori/laravel-microscope/src/Features/CheckUnusedBladeVars/ViewsData.php(35): Illuminate\\View\\Compilers\\BladeCompiler->compileString()
#7 /var/www/html/vendor/imanghafoori/laravel-microscope/src/Features/CheckUnusedBladeVars/UnusedVarsInstaller.php(34): Imanghafoori\\LaravelMicroscope\\Features\\CheckUnusedBladeVars\\ViewsData->readTokenizedVars()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Imanghafoori\\LaravelMicroscope\\Features\\CheckUnusedBladeVars\\UnusedVarsInstaller::Imanghafoori\\LaravelMicroscope\\Features\\CheckUnusedBladeVars\\{closure}()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(83): Illuminate\\Container\\Util::unwrapIfClosure()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(690): Illuminate\\Container\\BoundMethod::call()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1420): Illuminate\\Container\\Container->call()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(218): Illuminate\\Foundation\\Application->terminate()
#15 /var/www/html/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->terminate()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php(23): require_once('...')
#17 {main}
"} 

The behavior is really weird, and I do not understand it completely.

Steps To Reproduce

  1. Have an anonymous Volt component with changeable state.
  2. Update state somehow.
  3. Navigate to other page.
  4. Navigate back.
@crynobone
Copy link
Collaborator

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

@punyflash
Copy link
Author

Issue was caused by other package during updates when variable was not used in template: imanghafoori1/laravel-microscope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants