-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
'Module not found' when using twin.macro in MDX files #125
Comments
Those errors pop up when twin is run through the typescript compiler rather than the babel compiler. |
Thanks Ben, you're awesome as always. I will look into it. |
I found the issue. In Storybook 6.0 the {
"test": "/(stories|story).mdx/",
"use": [
{
"loader": "babel-loader/lib/index.js",
"options": {
"babelrc": false,
"configFile": false
}
}
]
} |
Looks like there's a @fvanwijk verified fix on the way with storybook which is great 😃 As a sidenote, twin will soon have a storybook starter/demo - I'm hoping it will help identify similar issues that pop up between versions. |
Fixed in [email protected], closing for now 👋 |
I've just added a storybook + emotion demo, more soon. |
Still its not fixed |
Oh really? Whats your setup look like @sivaraj-v ? |
I had a similar stack trace to @sivaraj-v, and it was caused by Ideally, we should have a check to warn of |
Are there any news on this? I am trying to use |
I'm also trying to use |
I was just upgrading to Storybook 6 and the stories won't compile anymore. It looks like twin.macro is the culprit, but I'm not sure.
So, I created a new CRA project, added
tailwindcss
,twin.macro
,styled-components
andtypescript
. I copied overtailwind.config.js
, the twin.macro config, and one simpleBadge.tsx
andBadge.stories.mdx
file. Both of the stories files use some<div tw="...">
stuff. I managed to reproduce the errors but everything seems to compile again when I remove the twin.macro import from the MDX file.In the terminal I see first some warnings
Same for "WARNING in ./node_modules/twin.macro/macro.js 40:61-80" and "WARNING in ./node_modules/babel-plugin-macros/node_modules/import-fresh/index.js 31:31-48"
Then errors:
(and more similar errors)
So my questions are:
As workaround I could extract all story boilerplate into tsx files, but I find it quite cumbersome to do this for something simple like 3 component examples in a grid.
The text was updated successfully, but these errors were encountered: