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

Duplicate use class lines when template comes before Volt methods #36

Closed
jacksleight opened this issue Aug 26, 2023 · 0 comments · Fixed by #38
Closed

Duplicate use class lines when template comes before Volt methods #36

jacksleight opened this issue Aug 26, 2023 · 0 comments · Fixed by #38
Assignees
Labels

Comments

@jacksleight
Copy link

Volt Version

1.0.0

Laravel Version

10.20.0

PHP Version

8.2.9

Database Driver & Version

No response

Description

When placing your template before the Volt methods any use class lines get duplicated, resulting in "name is already in use" errors. It works fine if the template comes after the Volt methods.

Steps To Reproduce

With this component:

<div>
    // my template
</div>

<?php
use App\Concerns\Form;
use function Livewire\Volt\{uses};

uses(Form::class);

This is the compiled PHP:

<?php

use App\Concerns\Form;

?>

<div>
    // my template
</div>

<?php
use App\Concerns\Form;
use function Livewire\Volt\{uses};

uses(Form::class); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants