Describe the bug
Some platforms already polyfill Headers, breaking
@bufbuild/connect-node due to https://github.com/bufbuild/connect-es/blob/a717308d2268f5337e8983d5dfb5636cb18d69e6/packages/connect-node/src/node-headers-polyfill.ts#LL28C5-L28C80. This should log a warning instead.
Polyfill headers and then import
Environment (please complete the following information):
Add any other context about the problem here.
That is certainly a bug. The code should definitely not crash below v18 if
Headers already exists, and I don't even think it should produce a warning.
I agree that modifying globals is far from ideal. What you suggest is not a great option for us, because large parts of connect-es are universal, and we would pull the polyfill into bundles for web browsers.
To put things into perspective, Node.js v17 is already EOL, and v16 will be EOL in six months, so I hope you'll understand if we rather focus on other features.
Thank you for putting up the bug report!
|Issue Title||Created Date||Updated Date|