-
Notifications
You must be signed in to change notification settings - Fork 170
Open
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Description
Currently its not possible to use header-generator HeaderGenerator class inside Cloudflare workers as we get a the following error:
Error generating random headers with lib: ReferenceError: __dirname is not defined
I would be nice to use this library inside Cloudflare workers (or other runtimes that don't have all of NodeJs's FS APIs).
Looking at the code there are two places which are causing this issue;
- Loading JSON files which could be resolved by adding
resolveJsonModuletotsconfig.json.
https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/src/header-generator.ts#L215 - Which is a tricky problem, is with passing in a string path to BayesianNetwork that uses another library called adm-zip, maybe this code can be made optional so it can work in Cloudflare workers??
https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/src/header-generator.ts#L236
Metadata
Metadata
Assignees
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.