fix: use namespace import for glob package#959
Closed
aleclarson wants to merge 1 commit intomicrosoft:mainfrom
Closed
fix: use namespace import for glob package#959aleclarson wants to merge 1 commit intomicrosoft:mainfrom
glob package#959aleclarson wants to merge 1 commit intomicrosoft:mainfrom
Conversation
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.
Crystal-RainSlide
approved these changes
Jun 21, 2024
There was a problem hiding this comment.
LGTM, but glob's version is not supported:
> npm i @vscode/vsce
npm warn deprecated inflight@1.0.6: 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 glob@7.2.3: Glob versions prior to v9 are no longer supported
> npm -g ls inflight
`-- @vscode/vsce@2.29.0
`-- glob@7.2.3
`-- inflight@1.0.6
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 =>
Contributor
|
Fixed by updating dependency #1027 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was getting an error from the
promisify(glob)call, as theglobimport was being resolved to undefined at runtime. Switching to a namespace import likeimport * as globand changing the reference toglob.defaulthas fixed the issue for me.Tested on Node v19, v20, and v21