-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Docs: Fix issue with referencing non-story files with names similar or equal to docs files #21348
Docs: Fix issue with referencing non-story files with names similar or equal to docs files #21348
Conversation
A MDX file can reference a component or other non-story file with the same prefix as an MDX file, which leads to a matching entry in the cache but that entry will not have been processed yet. That's OK, we just assume that import is not a story file (rather than throwing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of confusing, but I guess it's OK.
Is there anything that the throw new Error
was protecting us against that we are no longer protected from? Is there some other way to handle that case?
Yeah, I guess the code path is pretty weird, it's like:
I'm not quite sure why there are two loops. I'll refactor. |
And, no, I don't think it was protecting us from anything. It was a "if this is missing something weird is going on" type throw, not a "we expect this to fail in certain circumstances". |
@tmeasday looks like your refactor broke something in CI |
Closes #20958
A MDX file can reference a component or other non-story file with the same prefix as an MDX file, which leads to a matching entry in the cache but that entry will not have been processed yet. That's OK, we just assume that import is not a story file (rather than throwing).
How to test
See test cases and example from issue.
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]