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
I've face an issue while doing some codemod (to migrate to v7).
Here's the bug I faced when running npx storybook@latest migrate csf-2-to-3:
Transformation error (The expression evaluated to a falsy value: assert_1.default.ok(lines instanceof linesModule.Lines) )
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert_1.default.ok(lines instanceof linesModule.Lines)
Describe the bug
Hi thank you for all the work you are doing!
I've face an issue while doing some codemod (to migrate to v7).
Here's the bug I faced when running
npx storybook@latest migrate csf-2-to-3
:This happens when there are multiple version of recast installed. benjamn/recast#645 (comment)
Here's what I had installed:
$ npm ls recast REDACTED ├─┬ @storybook/addon-docs@7.0.18 │ └─┬ @storybook/csf-tools@7.0.18 │ └── recast@0.23.1 deduped ├─┬ @types/jscodeshift@0.11.6 │ └── recast@0.20.5 ├─┬ apollo@2.34.0 │ └─┬ apollo-codegen-core@0.40.9 │ └── recast@0.21.5 ├─┬ jscodeshift@0.15.0 invalid: "^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0" from node_modules/jscodeshift-add-imports │ └── recast@0.23.1 └─┬ storybook@7.0.18 └─┬ @storybook/cli@7.0.18 ├─┬ @storybook/codemod@7.0.18 │ ├─┬ jscodeshift@0.14.0 │ │ └── recast@0.21.5 │ └── recast@0.23.1 deduped └─┬ jscodeshift@0.14.0 └── recast@0.21.5
I was able to fix the issue by ensuring that there's only one version of recast installed on my porject:
With the override here's what I now have:
$ npm ls recast REDACTED ├─┬ @storybook/addon-docs@7.0.18 │ └─┬ @storybook/csf-tools@7.0.18 │ └── recast@0.23.1 deduped ├─┬ @types/jscodeshift@0.11.6 │ └── recast@0.23.1 ├─┬ apollo@2.34.0 │ └─┬ apollo-codegen-core@0.40.9 │ └── recast@0.23.1 deduped ├─┬ jscodeshift@0.15.0 invalid: "^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0" from node_modules/jscodeshift-add-imports │ └── recast@0.23.1 deduped └─┬ storybook@7.0.18 └─┬ @storybook/cli@7.0.18 ├─┬ @storybook/codemod@7.0.18 │ ├─┬ jscodeshift@0.14.0 │ │ └── recast@0.23.1 deduped │ └── recast@0.23.1 deduped └─┬ jscodeshift@0.14.0 └── recast@0.23.1 deduped
Now I'm able to run:
I think one fix would be to ensure that all storybook module are using the same version of recast.
To Reproduce
No response
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: