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

[fs] getKeys does not works for mounts within node_modules #477

Open
pi0 opened this issue Sep 4, 2024 · 2 comments
Open

[fs] getKeys does not works for mounts within node_modules #477

pi0 opened this issue Sep 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@pi0
Copy link
Member

pi0 commented Sep 4, 2024

Environment

Reproduction

Mount a driver within node_modules path.

Describe the bug

opts.ignore = ["**/node_modules/**", "**/.git/**"];

Additional context

No response

Logs

No response

@pi0 pi0 added the bug Something isn't working label Sep 4, 2024
@oritwoen
Copy link
Contributor

oritwoen commented Sep 5, 2024

"Today bug". Yesterday my script working perfectly fine.

Today, with this:

const storage = createStorage({
	driver: fsDriver({ base: "./" }),
});

const packages = await storage.getKeys();

I got:

file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/drivers/utils/node-fs.mjs:39
    entries.map(async (entry) => {
            ^

TypeError: entries.map is not a function
    at readdirRecursive (file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/drivers/utils/node-fs.mjs:39:13)
    at async file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/drivers/utils/node-fs.mjs:42:26
    at async Promise.all (index 2)
    at async readdirRecursive (file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/drivers/utils/node-fs.mjs:38:3)
    at async file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/drivers/utils/node-fs.mjs:42:26
    at async Promise.all (index 43)
    at async readdirRecursive (file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/drivers/utils/node-fs.mjs:38:3)
    at async Object.getKeys (file:///home/oritwoen/Projekty/Archex/node_modules/.pnpm/unstorage@1.11.1/node_modules/unstorage/dist/index.mjs:314:25)
    at async file:///home/oritwoen/Projekty/Archex/build.mjs:10:18

@pi0
Copy link
Member Author

pi0 commented Sep 5, 2024

@oritwoen i'm not sure it is the same issue... And also this stackblitz works with latest version.

If you could make a reproduction, please open a new issue 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants