Skip to content

Vendor view syntax fails to load vendor templates #188

Closed
@secondmanveran

Description

@secondmanveran

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions