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

Bugfix: handle undefined <style> tag attr.name #843

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LucasMatuszewski
Copy link

I've faced an issue when attr.name was undefined.
For example when spreading an object inside the <style> tag like this:

<style {...(key && { key })} />

I got an error on the Storybook build:

Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: /home/lucas/project-name/src/utils/withStyles.tsx: Cannot read properties of undefined (reading 'name')
    at /home/lucas/project-name/storybook/node_modules/styled-jsx/dist/babel/index.js:21535:26

And in the debugger:

Exception has occurred: TypeError: Cannot read properties of undefined (reading 'name')
  at /home/lucas/DEV/project-name/storybook/node_modules/styled-jsx/dist/babel/index.js:21535:26

I have applied the same fix as the one in isGlobalEl function from JJ Kasper (January 6th, 2019 6:09 PM).

Sorry, if I should create an issue first ;)

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

1 participant