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

RangeError on big folders #47

Open
dwidge opened this issue May 25, 2022 · 5 comments
Open

RangeError on big folders #47

dwidge opened this issue May 25, 2022 · 5 comments

Comments

@dwidge
Copy link
Contributor

dwidge commented May 25, 2022

When a very big folder is present in srcDir, sometimes we get RangeError: Maximum call stack size exceeded, even if we exclude the folder. Also takes time to deep scan the folder.

syncdir srcDir targetDir -e node_modules

Related:
JS-DevTools/readdir-enhanced#11

@hoperyy
Copy link
Owner

hoperyy commented May 26, 2022

Good job!

@tehvgg
Copy link

tehvgg commented Dec 21, 2022

I see this changed to no-deep but it doesn't behave as expected.

I add -e node_modules and the expectation should automatically be that excluded folders are not looked at in any way... I get the call stack error with -e but I don't get one without it (sync-dir starts copying everything in node_modules).

I used -nd along with the -e but now it's only syncing my top level files.

@dwidge original update seemed to target just the impact of -e, but the current behavior is that -nd impacts the entire scope instead.

@hoperyy
Copy link
Owner

hoperyy commented Dec 22, 2022

@tehvgg I'm not quite sure if this is a reproducible bug. I've tested the options below: -nd; -e

srcDir is like this:

image

sync-dir srcDir targetDir -e dir1

image

sync-dir srcDir targetDir -e dir1 -nd

image

Can you show your directory structure or other to represent this bug?

@tehvgg
Copy link

tehvgg commented Jan 13, 2023

@hoperyy sorry for the delayed reply, I didn't know I had notifications off

My folder structure is a bit different:

project-a/
  src/
  node_modules/
  package.json

project-b/
  src/
  node_modules/
  package.json

I make changes inside project-b/src and want those changes to be copied over to project-a/node_modules.

project-a and project-b are sibling folders, and my script runs from inside project-a

sync-dir ../project-b/packages/foo ./node_modules/@internal/foo -e node_modules -w -nd

Normally I would use yarn link but this is a React Native project and there's symlink issues with RN.

@dwidge
Copy link
Contributor Author

dwidge commented Jan 17, 2023

readdirEnhanced can skip deep scan if passed filter function

deep: nodeep ? filter : true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants