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

Style declaration including only null values result in errors being thrown #10

Closed
RimanDk opened this issue Jan 15, 2024 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@RimanDk
Copy link

RimanDk commented Jan 15, 2024

The problem
Style objects that include only entries with null values result in stylex.create should never be called. It should be compiled away. exception.

How to reproduce
Steps to reproduce:

  1. Create a React + TypeScript project with StyleX
  2. Create a style block/declaration including only null values, f.ex:
const styles = stylex.create({
  test: {
    padding: null,
  }
});
  1. Apply to any node in a given component

Code Sandbox example (expand console in the browser window - might need a reload to show up)

@nonzzz
Copy link
Owner

nonzzz commented Jan 15, 2024

I think you should link this issue to stylex, vite-plugin-stylex-dev is a wrapper for vite. If stylex don't allowed this edge case, this plugin also can't.

@RimanDk
Copy link
Author

RimanDk commented Jan 15, 2024

I think you should link this issue to stylex, vite-plugin-stylex-dev is a wrapper for vite. If stylex don't allowed this edge case, this plugin also can't.

They pointed me to you =)

facebook/stylex#344

@nonzzz
Copy link
Owner

nonzzz commented Jan 15, 2024

@RimanDk Ok, I will check it thanks for you report

@nonzzz nonzzz added the bug Something isn't working label Jan 15, 2024
@RimanDk
Copy link
Author

RimanDk commented Jan 15, 2024

@RimanDk Ok, I will check it thanks for you report

Thank you! 🙏

@nonzzz nonzzz self-assigned this Jan 15, 2024
@nonzzz
Copy link
Owner

nonzzz commented Jan 15, 2024

I fixed it. The new version has been released, even if the style is empty the result should still be returned.

@nonzzz nonzzz closed this as completed Jan 15, 2024
@RimanDk
Copy link
Author

RimanDk commented Jan 16, 2024

I fixed it. The new version has been released, even if the style is empty the result should still be returned.

Indeed, appears to be resolved! Thank you! Much appreciated!

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