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

filter out undefined rules #327

Closed
wants to merge 1 commit into from
Closed

Conversation

williamkunz
Copy link

I came across this issue during a Friday (today) prod push, of course. This was a 2 minute fix but has seemingly fixed issue #319

I haven't deep dived into the source so if there is a more elegant fix required, feel free to close.

@williamkunz
Copy link
Author

I'll keep digging to see if there is a better solution

@williamkunz
Copy link
Author

Upon further digging, 319 may be a non-issue.

From converting Glamor code we had an external string:

import css from 'styled-jsx/css'

export const myStyles = css`
  .my-class: {
    padding: 1.6rem;
  }
`

vs. the correct:

import css from 'styled-jsx/css'

export const myStyles = css`
  .my-class {
    padding: 1.6rem;
  }
`

The extra colon was just leftover from the conversion and causing the same error as described in #319. Maybe this issue should become an optimization with some warning within the css module?

@giuseppeg
Copy link
Collaborator

@williamkunz yeah whenever there is a parse error the rule is ignored. This happens only when optimizeForSpeed is enabled (usually automatically for production builds). To prevent surprises in prod you may want to enable optimizeForSpeed manually (via babel plugin options) while you are developing. When optimizeForSpeed is enabled and process.env.NODE_ENV !== 'production' you should get a warning.

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.

2 participants