Skip to content

Commit

Permalink
fix: override whatwg-url version to prevent punycode warning
Browse files Browse the repository at this point in the history
The openai package transitively depends on an outdated version of
whatwg-url, which causes nodejs to print a deprecation warning for
punycode when running the vision tool. This will be fixed when openai
resolves openai/openai-node#392. Until then,
override the version of whatwg-url in order to prevent the deprecation
warning.

See openai/openai-node#527 (comment)
for details on this stopgap.

Signed-off-by: Nick Hale <[email protected]>
  • Loading branch information
njhale committed Mar 4, 2024
1 parent 0c32381 commit c8fa72d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Command, Option } from 'commander';
import { fileTypeFromBuffer } from 'file-type';
import { URL } from 'whatwg-url';
import fs from 'fs';
import OpenAI from 'openai';

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"dependencies": {
"commander": "^9.0.0",
"file-type": "^19.0.0",
"openai": "^4.28.0",
"whatwg-url": "^14.0.0"
"openai": "^4.28.0"
},
"overrides": {
"whatwg-url": "13.0.0"
}
}

0 comments on commit c8fa72d

Please sign in to comment.