'css' is not exported from 'styled-components/macro'
See original GitHub issueimport css using twin.macro with styled-components fails. Below is the error when running local in my machine the cra-styled-component example. It works on codesandbox, but not local.
./src/components/Button.js
Attempted import error: 'css' is not exported from 'styled-components/macro' (imported as '_css').
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
re export styled from styled components macro not working
I tried with export { css, createGlobalStyle, keyframes, ThemeProvider, withTheme, styled } . But without success. import React from 'react'; ...
Read more >API Reference - styled-components
This is the default export. This is a low-level factory we use to create the styled.tagname helper methods. Arguments, Description ...
Read more >FAQs - styled-components
In general, always use the css helper when composing styling partials to be interpolated into a styled component.. import styled, { keyframes } ......
Read more >Tooling - styled-components
You may want to ensure that objects are consistently imported from the macro across your project. This can be achieved by using a...
Read more >Releases - styled-components
Fixed the TS declarations not getting emitted correctly by rollup. ... Fix usage of the "css" prop with the styled-components babel macro (relevant...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m seeing this too when I use
yarn
to install.npm works fine- I’ll have to look into this issue further.You can fix it for now by using this twin config:
Has babel updated something lately?
FYI, I just tried this with
npm install
and I got the same errorSo I cleared away the repo, and tried again using
yarn
and everything seems to work.