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.
To Reproduce
Polyfill headers and then import @bufbuild/connect-node
.
Environment (please complete the following information):
Additional context
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!
Owner Name | bufbuild |
Repo Name | connect-es |
Full Name | bufbuild/connect-es |
Language | TypeScript |
Created Date | 2022-02-16 |
Updated Date | 2023-03-24 |
Star Count | 852 |
Watcher Count | 20 |
Fork Count | 33 |
Issue Count | 17 |
Issue Title | Created Date | Updated Date |
---|