-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: support scanoss bundling #14650
fix: support scanoss bundling #14650
Conversation
7e4cf5e
to
4f11c6b
Compare
scanoss depends on node-fetch <3. node-fetch in that version fails their instance checks, as it relies on constructor/class names which are removed by the backend bundling. Adjusts the generated webpack configuration to keep the class name for AbortSignal as this is the name checked in node-fetch. fixes eclipse-theia#14648
4f11c6b
to
20d77e7
Compare
@sdirix when I press the "scanoss" button in the chat view on a production build of the electron version, nothing happens and I get the following exception:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to have no untoward effects on Theia in the production build. Can't test it fixes the ScanOSS problem until we have the other Windows fix merged, but at least it's no worse (the feature does not work anyway)
scanoss depends on node-fetch <3. node-fetch in that version fails their instance checks, as it relies on constructor/class names which are removed by the backend bundling. Adjusts the generated webpack configuration to keep the class name for AbortSignal as this is the name checked in node-fetch. fixes #14648
The error mentioned was an issue only appearing on Windows. It was fixed here: #14653 |
What it does
scanoss depends on
node-fetch
<3
.node-fetch
in that version fails their instance checks, as it relies on constructor/class names which are removed by the backend bundling.Adjusts the generated webpack configuration to keep the class name for AbortSignal as this is the name checked in node-fetch.
fixes #14648
How to test
yarn && yarn browser build:production
Without the adjusted webpack generation, scanoss will fail
Follow-ups
As an alternative we could set a resolution to node-fetch >3, however
node-fetch
in that version deprecated support forform-data
dependency which is used byscanoss
.So to get rid of this workaround we need to either
scanoss
to migrate tonode-fetch
v3
and replaceform-data
usage, AND/ORnode-fetch
to backport their improved checks to version v2
Note that the
ai-openai
andai-anthropic
also have a dependency tonode-fetch
v2
, however during regular use we don't seem to hit the problematic code paths in there, at least I was not able to trigger them.Breaking changes
Review checklist
Reminder for reviewers