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

Filenames with hyphens "-" #91

Closed
djoks opened this issue Feb 11, 2024 · 5 comments
Closed

Filenames with hyphens "-" #91

djoks opened this issue Feb 11, 2024 · 5 comments
Assignees

Comments

@djoks
Copy link

djoks commented Feb 11, 2024

Volt Version

1.6

Laravel Version

10.10

PHP Version

8.3.1

Database Driver & Version

No response

Description

I do not know if this has already been mentioned however I struggled getting my volt component to work, my file name "location-picker" seemed to be the cause. My methods were not recognized and neither were some other features I was expecting to work. Also I was any to use props within my component.

I do not see any mention of this in the docs about filenames not supposed to have hyphens.

Steps To Reproduce

Create a simple volt component with a hyphen in its name. eg. "example-picker.blade.php"
Create some state values and methods.
Try accessing them from the view.
Try displaying the value of any one of the components props.

@inmanturbo
Copy link

Have you gotten any other components working in your app, or is it just the one?

@djoks
Copy link
Author

djoks commented Feb 11, 2024

Have you gotten any other components working in your app, or is it just the one?

So I created a new component with the exact same code but without a hyphen in the file name and it worked perfectly.

@driesvints
Copy link
Collaborator

Heya, thanks for reporting.

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"

Please 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!

@nunomaduro
Copy link
Collaborator

Volt's internal test suite contains dozens of components with hyphens, and they are working as expected. Can you follow @driesvints's instructions to create a reproduceable scenario please?

Screenshot 2024-02-12 at 09 21 26

@nunomaduro
Copy link
Collaborator

Closing this issue due to the lack of activity.

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

4 participants