Skip to content

Webpack omitting @emotion/styled; Uncaught ReferenceError: _styled is not defined thrown at runtime #29317

Answered by vergenzt
vergenzt asked this question in Q&A / Help
Discussion options

You must be logged in to vote

Huzzah! I may have at least figured out a workaround! 🎉

Converting that particular file to use a re-export syntax (export ... from '...') instead of an import followed by export const ... seems to have worked around the issue for me. Webpack builds continue to succeed as before, and main dashboard UI now loads fully without throwing the error described above.

Diff:

diff --git a/superset-frontend/packages/superset-ui-core/src/style/index.tsx b/superset-frontend/packages/superset-ui-core/src/style/index.tsx
index ee0b6e10ac4199fbca8ff92fa83cc424ddc00715..39cdfa294fb390270d2104f7faed567a79d46803 100644
--- a/superset-frontend/packages/superset-ui-core/src/style/index.tsx
+++ b/superset-front…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@vergenzt
Comment options

@alibertz
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by vergenzt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants