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

sourcemaps break the css`` API #455

Closed
johnbrett opened this issue Nov 10, 2017 · 0 comments · Fixed by #458
Closed

sourcemaps break the css`` API #455

johnbrett opened this issue Nov 10, 2017 · 0 comments · Fixed by #458
Assignees
Labels

Comments

@johnbrett
Copy link

Fantastic work on this library btw, I was last working with v6, lots of improvements since I see 👍

  • emotion version: 8.0.10
  • react version: 16.1.0

Relevant code.

const redBG = css`background-color: red`
injectGlobal`
  h2 {
    color: green;
  }
`

class App extends Component {
  render() {
    return (
      <div className={redBG}>
          <h2>testing</h2>
      </div>
    );
  }
}

What you did:
I enabled sourceMaps in a create-react-app rewired project:

module.exports = function override(config, env) {
  return rewireEmotion(config, env, { sourceMap: true  });
}

What happened:
The effects of the css API no longer worked, although the css class was created on the element.

image

Reproduction:

Github repo: https://github.com/johnbrett/emotion-testing

Happy to try debug this further / submit a fix with guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants