Hi Greg,
Thanks for your work.
I'd like to use your algoliasearch wrapper for Cloudflare worker. I use it for replacing algoliasearch in my Cloudflare Pages function (light worker embedded in pages). Since original algoliasearch use XHR wich is not supported by Cloudflare I thought that your work is THE solution.
in my package.json I declared:
"@glenstack/cf-workers-algolia-search": "^1.0.2",
and in my function:
import algoliasearch from "@glenstack/cf-workers-algolia-search";
But Wrangler2 complains about missing crypto module
Compiling worker to "/var/folders/07/873_g9sx2zjdm0qzs62h_nvr0000gn/T/functionsWorker.js"...
✘ [ERROR] Could not resolve "crypto"
node_modules/@glenstack/cf-workers-algolia-search/node_modules/@algolia/client-search/dist/client-search.cjs.js:8:21:
8 │ var crypto = require('crypto');
╵ ~~~~~~~~
The package "crypto" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
1 error(s) and 0 warning(s) when compiling Worker.
Build failed with 1 error:
node_modules/@glenstack/cf-workers-algolia-search/node_modules/@algolia/client-search/dist/client-search.cjs.js:8:21: ERROR: Could not resolve "crypto"
If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new.
Cloudflare Worker does not require deprecated crypto 1.0.1 since it provides directly Web Crypto Subtle https://developers.cloudflare.com/workers/runtime-apis/web-crypto/
Hi Greg,
Thanks for your work.
I'd like to use your algoliasearch wrapper for Cloudflare worker. I use it for replacing algoliasearch in my Cloudflare Pages function (light worker embedded in pages). Since original algoliasearch use XHR wich is not supported by Cloudflare I thought that your work is THE solution.
in my package.json I declared:
and in my function:
But Wrangler2 complains about missing crypto module
Cloudflare Worker does not require deprecated crypto 1.0.1 since it provides directly Web Crypto Subtle https://developers.cloudflare.com/workers/runtime-apis/web-crypto/