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

fix: use namespace import for glob package #959

Closed
wants to merge 1 commit into from

Conversation

aleclarson
Copy link

@aleclarson aleclarson commented Apr 15, 2024

I was getting an error from the promisify(glob) call, as the glob import was being resolved to undefined at runtime. Switching to a namespace import like import * as glob and changing the reference to glob.default has fixed the issue for me.

Tested on Node v19, v20, and v21

I was getting an error from the `promisify(glob)` call, as the `glob` import was being resolved to undefined at runtime. Switching to a namespace import like `import * as glob` and changing the reference to `glob.default` has fixed the issue for me.
Copy link

@Crystal-RainSlide Crystal-RainSlide left a comment

Choose a reason for hiding this comment

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

LGTM, but glob's version is not supported:

> npm i @vscode/vsce
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

> npm -g ls inflight
`-- @vscode/[email protected]
  `-- [email protected]
    `-- [email protected]

An update would be great. Or it can be another PR.

If update to v10, which is async by default, that would be:

import { glob } from 'glob';
// ...
glob('**', { cwd: dep, nodir: true, dot: true, ignore: 'node_modules/**' }).then(files =>

@benibenj benibenj self-assigned this Jun 22, 2024
@benibenj
Copy link
Contributor

Fixed by updating dependency #1027

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

Successfully merging this pull request may close these issues.

3 participants