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

Vendor view syntax fails to load vendor templates #188

Open
secondmanveran opened this issue Aug 22, 2023 · 1 comment
Open

Vendor view syntax fails to load vendor templates #188

secondmanveran opened this issue Aug 22, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@secondmanveran
Copy link

What happened?

I have a simple todo app built in Livewire 3 with pagination. My app uses dark mode so I have to publish the Livewire pagination views in order to add support for dark mode.

As per the normal those views live at:

resources/views/vendor/livewire/

When loading a custom pagination template in Livewire pagination you have to pass the view to the links() method:

<div class="my-2">
  {{ $todos->links('livewire::tailwind') }}
</div>

When running this in a normal server via Valet or artisan serve this loads up the vendor template fine.

But when running in the NativePHP dev server these do not resolve and fall back to the Livewire default templates.

Curiously, it won't load the custom templates even if I move them out of the vendor directory, and even weirder, NativePHP will ONLY load the simple pagination template, even though simplePaginate is not being called, as you can see here:

public function render()
{
  $todos = Todo::latest()->where(
    'name', 'like', "%{$this->search}%"
  )->paginate(5);

  return view('livewire.todo-list', compact('todos'));
}

Very strange indeed.

How to reproduce the bug

When running under a normal PHP server pagination loads as expected, but under the NativePHP dev server only the default Livewire simple pagination templates are resolved.

Package Version

0.4.0

PHP Version

8.2.8

Laravel Version

10.19.0

Node Version

18.17.0

Which operating systems does with happen with?

macOS

Notes

macOS 13.14.1 (c)

  • Processor: 2.3 GHz 8-Core Intel Core i9
  • Graphics: AMD Radeon Pro 5500M 8 GB Intel UHD Graphics 630 1536 MB
  • Memory: 16 GB 2667 MHz DDR4
@secondmanveran secondmanveran added the bug Something isn't working label Aug 22, 2023
@simonhamp
Copy link
Member

I've seen something similar at times and I suspect that it's to do with view caching somewhere inside the native application's storage.

It may be that those caches aren't being cleared out properly when the app is rebuilt.

I will do some digging

@simonhamp simonhamp self-assigned this Apr 28, 2024
@simonhamp simonhamp changed the title [Bug]: Vendor view syntax fails to load vendor templates Vendor view syntax fails to load vendor templates May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants