You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hiya! There was a previous issue about this (#3256), but it was closed with instructions on how to configure the user's bundler to work around the issue.
I've done some spelunking and found the root cause here: styled-components is trying to use named imports with a CommonJS package. This does sometimes work in Node or a configured bundler, however react-is is a package that uses conditional commonjs re-exporting techniques that cause it to fail.
The solution here is actually deceptively simple: styled-components.*.esm.js should use a default import for react-is, not named imports. Or it could go the extra mile and do interop:
This issue is caused by a configuration mix-up in styled-component's Rollup config: the rollup-plugin-commonjsnamedExports option is used for react-is, however this is never applied because the module is marked as external (and thus never processed by the plugin).
I can submit a PR to fix this if there's a willingness to merge!
The text was updated successfully, but these errors were encountered:
developit
added a commit
to developit/styled-components
that referenced
this issue
Jan 6, 2021
Hiya! There was a previous issue about this (#3256), but it was closed with instructions on how to configure the user's bundler to work around the issue.
I've done some spelunking and found the root cause here:
styled-components
is trying to use named imports with a CommonJS package. This does sometimes work in Node or a configured bundler, howeverreact-is
is a package that uses conditional commonjs re-exporting techniques that cause it to fail.The solution here is actually deceptively simple:
styled-components.*.esm.js
should use a default import forreact-is
, not named imports. Or it could go the extra mile and do interop:Current styled-components.esm.js (incorrect):
Fixed version:
Fancy interop version:
This issue is caused by a configuration mix-up in styled-component's Rollup config: the
rollup-plugin-commonjs
namedExports
option is used forreact-is
, however this is never applied because the module is marked as external (and thus never processed by the plugin).I can submit a PR to fix this if there's a willingness to merge!
The text was updated successfully, but these errors were encountered: