Skip to content

Conversation

@dlehmhus
Copy link
Contributor

Motivation

Fixes: !144
This PR addresses an issue where the cache did not correctly handle cases when an object was undefined.

Summary

  • Updated the cache implementation to properly handle cases where the cached object is undefined.
  • Added a test in cache.test.ts to cover this scenario and ensure correct behavior.

Test plan

  • Added a new test in packages/transform/src/tests/cache.test.ts to verify that the cache correctly handles undefined objects.
  • Ran the test suite to confirm that all tests pass and the new case is covered.

@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2025

⚠️ No Changeset found

Latest commit: cd50bb5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

kurtdoherty added a commit to reapit/elements that referenced this pull request Jul 31, 2025
Linaria 0.7.0 does not play nicely with empty classes/styled elements, sometimes throwing build errors like `[wyw-in-js] Cannot use 'in' operator to search for 'initialCode' in undefined`. There is an [issue raised](Anber/wyw-in-js#144) and a [PR to fix it](Anber/wyw-in-js#147), but it remains unmerged.

This PR adds a CSS comment to all currently empty classes/styled elements. This appears to avoid the build issues, though given the build issues are intermittent anyway, it's hard to know if this will stand up over time.
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.

Crash in 0.7.0 with empty css``

1 participant