Skip to content
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

Vite: downgrade remark related dependencies #21836

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Mar 30, 2023

What I did

#21796 included remark plugins but unfortunately they mismatch with the dependencies of addon-docs, which causes issues when running yarn link:

Error: Assertion failed: Writing attempt prevented to /Users/yannbraga/open-source/storybook/code/frameworks/react-vite/node_modules/@storybook/builder-vite which is outside project root: /Users/yannbraga/open-source/storybook/sandbox/react-vite-default-ts
    at nb (/Users/yannbraga/open-source/storybook/sandbox/react-vite-default-ts/.yarn/releases/yarn-3.5.0.cjs:709:1786)
    at Nle (/Users/yannbraga/open-source/storybook/sandbox/react-vite-default-ts/.yarn/releases/yarn-3.5.0.cjs:709:2357)

and here's a little more explanation:

builder-vite::locator=before-storybook%40workspace%3A. - previously hoisted dependency mismatch, needed: remark-external-links@9.0.1, available: remark-external-links@8.0.0
│ ├─is-absolute-url@4.0.1 - filled by: is-absolute-url@3.0.3 at .
│ ├─mdast-util-definitions@5.1.2 - filled by: mdast-util-definitions@4.0.0 at .
│ ├─mdast-util-to-string@3.1.1 - filled by: mdast-util-to-string@1.1.0 at .
│ ├─remark-external-links@9.0.1 - filled by: remark-external-links@8.0.0 at .
│ ├─remark-slug@7.0.1 - filled by: remark-slug@6.1.0 at .
│ ├─space-separated-tokens@2.0.2 - filled by: space-separated-tokens@1.1.5 at .
│ ├─unist-util-is@5.2.1 - filled by: unist-util-is@4.1.0 at .
│ ├─unist-util-visit@4.1.2 - filled by: unist-util-visit@2.0.3 at .
│ ├─unist-util-visit-parents@5.1.3 - filled by: unist-util-visit-parents@3.1.1 at .

This issue blocks the creation of Vite sandboxes locally. In this PR I downgraded the remark versions, however I do not know the effects of it @JReinhold please check this out!

The alternative solution would be to upgrade the dependency in addon-docs, however I don't know the effects of that either.

How to test

  1. Run a sandbox for a vite template, e.g. yarn task --task sandbox --start-from auto --template react-vite/default-ts
  2. It should work

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@yannbf yannbf added maintenance User-facing maintenance tasks builder-vite labels Mar 30, 2023
Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yannbf! The dependencies added to builder-vite should match those in addon-docs like they do in this PR, I hadn't thought about checking the version.

I'm sorry for not catching that this breaks locally.

It doesn't matter which version to use, they are almost identical so I'm fine with this PR.

I've added a follow up issue to replace the dependencies entirely. #21838

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder-vite maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants