unjs / node-fetch-native

better fetch for Node.js. Works on any JavaScript runtime!
Other
166 stars 5 forks source link

How to disable non-node environment warning in cloudflare workers #130

Open zou-yu opened 1 month ago

zou-yu commented 1 month ago

Environment

nodejs 20

Reproduction

no need

Describe the bug

"[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning."

In cloudflare worker, there is no process.env or environment variables, so how can I set DISABLE_NODE_FETCH_NATIVE_WARN to disable this warning. Or any other solution to disable this warning

Additional context

No response

Logs

No response

pi0 commented 1 month ago

Can you please share a full reproduction repo? I guess this resolution issue is not originating from this library. (and it is important issue!)