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

fix: error when css calls reference css calls inside components #971

Merged
merged 1 commit into from May 29, 2022

Conversation

GabbeV
Copy link
Contributor

@GabbeV GabbeV commented May 15, 2022

Motivation

fix: #957

Summary

The issue was caused by the referenced template getting hoisted, converting the path already added to state.queue into an identifier referencing the hoisted variable. The code processing the queue expected all paths to be tagged template literals and crashed when trying to access path.get('quasi').get('expressions').

Avoiding hoisting templates when referenced in other templates seem to have solved the problem.

@callstack-bot
Copy link

Hey @GabbeV, thank you for your pull request 🤗.
The coverage report for this branch can be viewed here.

@Anber
Copy link
Collaborator

Anber commented May 29, 2022

Hi @GabbeV!

Thank you!
It will fix the problem. However, I don't recommend calling css inside components or functions. It doesn't make any sense since you cannot use passed args/props for interpolation. It also can cause some unforeseen problems.

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.

Cannot read properties of undefined (reading 'expressions')
3 participants