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

feat: Adds descriptive warning for undefined x-for key and updates tests. #3498

Merged
merged 1 commit into from May 10, 2023

Conversation

nickdawes
Copy link
Contributor

Description:
This pull request addresses the issue where the x-for directive would throw a generic error message when the provided key is undefined or invalid.

The changes include:
Updating the Alpine.js code to throw a more descriptive error message when the key is undefined or invalid in the x-for directive.
Adding a new test case to the Cypress test suite to check for the updated error message when the key is undefined.

Here is the summary of the changes made:
Updated the error message for an undefined or invalid key in the x-for directive.
Added a new test case to the Cypress test suite to check for the updated error message.

Why was this change necessary?
By providing a more descriptive error message, developers can quickly identify the issue and fix their code accordingly.

Please review the changes and let me know what you think.

@calebporzio
Copy link
Collaborator

Thanks!

@calebporzio calebporzio merged commit 9ad43f1 into alpinejs:main May 10, 2023
1 check passed
@ekwoka
Copy link
Contributor

ekwoka commented May 10, 2023

Is this the correct place for this message to appear? Couldn't it be checking the result of the key evaluation?

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

Successfully merging this pull request may close these issues.

None yet

3 participants