question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react_1.styled is not a function

See original GitHub issue

I took the evening to migrate my library from using styled-components to stitches. When I start Storybook, the styles get applied perfectly. However, when I build the library and install it somewhere else, I get: react_1.styled is not a function. (see here).

This is the branch of my library where I am using stitches now: https://github.com/table-library/react-table-library/tree/feat/stitches Compared to using styled-components (or emotion), I thought I wouldn’t have to change anything in the tsconfig.json or babel.config.js to make it work. Or am I wrong here? I am using rollup to bundle everything.

Thanks for your help! Really looking forward getting this to work!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:14

github_iconTop GitHub Comments

3reactions
jnoercommented, Jul 17, 2022

I get the same with brand new minimal apps. This is a brand new create-react-app application with only storybook and Stitches installed. It exports one button: https://github.com/jnoer/storybook/tree/no-stitches-config

Target application. It’s a brand new create-react-app that imports the above button component: https://github.com/jnoer/react-app/tree/no_stitches_config

I tested with Emotion instead of Stitches and that does work.

@hadihallak Can we reopen this?

I had opened this issue which is the same, but the error is a little different since it uses stitches.config.js. https://github.com/stitchesjs/stitches/issues/1061

1reaction
jnoercommented, Dec 1, 2022

React 18 is not supported. See https://github.com/stitchesjs/stitches/issues/1059

We have switched over to Emotion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styled.div is not a function after rollup built of format "es" #3700
Debugging within the lib's built has shown that styled.div is indeed undefined since styled holds default and just then has div ( styled.default ......
Read more >
reactjs - type error extend is not a function in styled components
The CustomElement.extend function was removed in styled components version 4, so you must be using version 4 or above, where it no longer ......
Read more >
API Reference - styled-components
A utility to help identify styled components. Arguments, Description. 1. Function, Any function expected to possibly be a styled component or React component ......
Read more >
Styled Components - Emotion
styled is a way to create React components that have styles attached to them. ... literal for string styles or a regular function...
Read more >
DOM Elements - React
function createMarkup() { return {__html: 'First · Second'}; } function ... Not all style properties are converted to pixel strings though.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found