Comments (5)
Appears to be caused by, in this case, a Go project having a fakeGoPATH directory structure eventually symlinked back to its own go.mod in a relative parent directory
ls -l …
xyz -> ../../../..
I think this was something before Go modules became widely used
—
What one could do here is to model that scandir code on Go’s filepath.EvalSymlinks https://pkg.go.dev/path/filepath#EvalSymlinks
@google wrote that, it works
this code here walks anything avoiding recursion from cyclic paths. It doesn’t include the latest learnings but won’t crash
I don’t know for anybody else doing this. Like @facebook doesn’t
https://pkg.go.dev/github.com/haraldrudell/[email protected]/pfs#Traverser
walking symlinks is a huge problem space
This code could be easily transpiled to ECMAScript and it will work every time
from storybook.
@valentinpalkovic I am able to reproduce this in a sandbox:
- Remove
/sandbox
from.gitignore
- Run the sandbox and search for
button
=> it will return a bunch of results - Link a parent directory
ln -s ../../.. boom
- Run the sandbox and search for
button
=> it will hang -- I think it is traversing the symlink infinitely
I tried adding the following options to globby
but it did not fix the problem:
followSymbolicLinks: false,
onlyFiles: true,
When I remove gitignore: true
from the options:
- It does fix the problem (
followSymLinks
is respected) - The glob runs twice as fast (500ms vs 1000+ms with gitignore)
Therefore it seems globby
gitignore is buggy and also introduces a performance regression. I wonder if we can get a fix into globby
?
from storybook.
In my opinion, setting followSymbolicLinks: false
wouldn't be an option. Symlinks are common, and when properly set up, they usually don't cause loops.
Since globby
respects the user's gitignore, wouldn't a further entry in the gitignore file solve the issue by excluding the symlinked folder?
@shilman Also, could you experiment with the deep option? By default, it is set to Infinity.
Maybe we should limit the folder depth to, for example, 100.
from storybook.
@haraldrudell Just for context: We haven't implemented the glob search by ourselves, but we rely on the globby library. If you think cyclical symlinks should be treated in a different way, then I think it makes sense to open a bug report there, unless it is not configurable by globby itself.
from storybook.
@valentinpalkovic I don't think deep
is a good solution. deep: 50
still blows up, and deep: 20
works but takes 10 seconds to complete a single search.
This bug is important to me because I want to use fileSearch
as part of some telemetry and I need it to be performant. It would run on startup once per day (I'd cache the results). I suppose I could pass followSymbolicLinks: false
JUST for the telemetry case and we could leave it to true
for the search UI. But it's a bummer that gitignore doesn't play nice with followSymLinks
.
from storybook.
Related Issues (20)
- [Bug]: Seeing warning about CJS even though my project is ESM HOT 3
- [Bug]: themes.normal not working for docs pages HOT 6
- Blog Post: Highlight the feature
- [Bug]: Addon build fails due to missing @storybook/manager/globals on 8.2.5 HOT 3
- [Bug]: Upgrade still prompts for all automigrations HOT 1
- [Bug]: Incorrect null type error for ControlType HOT 1
- UI: solidify story status elements HOT 1
- UI: Rework footer filtering component and API HOT 1
- Remove/deprecate experimental bottomBar APIs in Storybook core [gert] HOT 1
- Move bottom bar button (filter) logic from VTA to Storybook [gert] HOT 1
- Migration strategy with different versions of Storybook+VTA (so that there is only filter UI)
- Rework file transformation logic [yann] HOT 1
- Use internal Storybook renderer logic for portable stories in 8.3 (as a default), as it will solve hard to debug race conditions and allows us to run the vitest test runner for all renderers [kasper]
- Portable stories: Refactor Storybook preview and Portable stories to reuse logic [kasper]
- Scaffold `@storybook/addon-vitest` with basic mocked test results [gert] HOT 1
- Server/browser state for status API from JUnit report [yann, gert] HOT 1
- [Bug]: Absolute import from MDX does not work HOT 2
- [Bug]: PNPM Install returning errors HOT 1
- [Bug]: Failed to build the preview SB_BUILDER-WEBPACK5_0002 (WebpackInvocationError): Module not found: Error: Can't resolve './Typography' in './components/Typography' HOT 1
- [Bug]: PanelPosition on mobile Viewports not working / is alway bottom HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook.