Closed marklawlor closed 3 years ago
This seems to fix the build, but the Storybook is failing with
Uncaught TypeError: _interopRequireDefault is not a function
at Object../node_modules/react-syntax-highlighter/dist/cjs/languages/prism/jsx.js (vendors~main.96bbda1226654fa44563.bundle.js:141158)
at __webpack_require__ (runtime~main.96bbda1226654fa44563.bundle.js:849)
at fn (runtime~main.96bbda1226654fa44563.bundle.js:151)
at Object../node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js (vendors~main.96bbda1226654fa44563.bundle.js:29490)
at __webpack_require__ (runtime~main.96bbda1226654fa44563.bundle.js:849)
at fn (runtime~main.96bbda1226654fa44563.bundle.js:151)
at Object../node_modules/@storybook/components/dist/index.js (vendors~main.96bbda1226654fa44563.bundle.js:29046)
at __webpack_require__ (runtime~main.96bbda1226654fa44563.bundle.js:849)
at fn (runtime~main.96bbda1226654fa44563.bundle.js:151)
at Object../node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs/dist/blocks/index.js (vendors~main.96bbda1226654fa44563.bundle.js:10641)
Related babel issues
Config merging (looks like tsdx uses the logic as Gatsby): https://github.com/babel/babel/issues/12851 _interopRequireDefault is not a function: https://github.com/babel/babel/issues/12854
@marklawlor yep looks like the same issue with createConfigItem
, so should be fixed soon https://github.com/formium/tsdx/blob/462af2d002987f985695b98400e0344b8f2754b7/src/babelPluginTsdx.ts#L1
It appears the latest version of
@babel/core
broke the config merging.
Yes, @babel/core
v7.13.0 was released just two hours ago and seems to have several bugs. https://github.com/babel/babel/issues/12851 is this error and https://github.com/babel/babel/issues/12852 recently fixed it an hour ago.
It is an upstream bug in Babel that many packages are hitting; it's not something TSDX can control. It's also incredibly recent and likely to be fixed by tomorrow if not within the next few hours.
Current workaround is to lock
package.json
to"@babel/core": "7.12.17"
via resolutions
You can also set your yarn.lock
or package-lock.json
. TSDX does not pin a newer version.
but the Storybook is failing with
That is also a bug in Babel, https://github.com/babel/babel/issues/12854, filed an hour ago, that was closed 5 minutes ago in https://github.com/babel/babel/issues/12855.
TSDX does not even depend on Storybook, it's just included in one of the templates, so a bug in Storybook is also not something TSDX can control. But neither can Storybook as that's a bug in Babel.
Would recommend focusing time upstream, but thanks for providing a workaround @marklawlor that should suffice for anyone installing within the next day or so until this is fixed upstream. (Yes, TSDX could hard pin to resolve this, but as I've previously stated, having all downstream packages churn multiple releases is not a good solution to an upstream issue -- contributing upstream is)
It's also incredibly recent and likely to be fixed by tomorrow if not within the next few hours.
@agilgur5, yep publishing a new version now! https://github.com/babel/babel/runs/1957418439
Ah it published when I posted, it should be fixed if you try again https://github.com/babel/babel/releases/tag/v7.13.1
Thanks @hzoo, y'all rock!
@marklawlor if you could confirm the fix and close out, that'd be great. I think the added tests in the Babel PRs cover our use-cases, but might find something else -- please report upstream to help the Babel team if so.
Hi from another node project Strapi o/
We tested v7.13.1 and it did not fix it for us, we issued a workaround for our community here: https://github.com/strapi/strapi/issues/9482#issuecomment-783797102
@agilgur5 v7.13.1 works for a clean install.
@derrickmehaffy cheers that fixed the last issue with my project
Current Behavior
Choose
react with storybook
Errors during the build phase with
It appears the latest version of
@babel/core
broke the config merging.Expected behavior
TSDX can create new projects
Suggested solution(s)
Current workaround is to lock
package.json
to"@babel/core": "7.12.17"
via resolutionsAdditional context
Your environment