You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to weird behavior in TypeScript (Mainly microsoft/TypeScript#37053) the use of /// <reference types="node" /> will leak to any consumers of a type definition file.
This means that if one wants to use some of the Stripe types, for example to define an interface for an API response (Which gets imported in the client) this will leak NodeJS types to all the client side code as well.
To Reproduce
Observe the Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node and then add 'node' to the types field in your tsconfig. error as expected
Hey @richardsimko, thanks for the report here! Given that it's a typescript bug, there's not much we can do here in the short term. Given that this package is primarily meant for use in Node environments, the node typings are important.
Long term, we could potentially look into separating the type definitions from the runtime code (to better support type-only usage) but it's not currently a priority for us.
I'll leave this issue open in the meantime if other folks want to 👍 it or have further feedback.
Describe the bug
Due to weird behavior in TypeScript (Mainly microsoft/TypeScript#37053) the use of
/// <reference types="node" />
will leak to any consumers of a type definition file.This means that if one wants to use some of the Stripe types, for example to define an interface for an API response (Which gets imported in the client) this will leak NodeJS types to all the client side code as well.
To Reproduce
Cannot find name 'process'. Do you need to install type definitions for node? Try
npm i --save-dev @types/nodeand then add 'node' to the types field in your tsconfig.
error as expectedstripe
Expected behavior
The error regarding
process
persistsCode snippets
Minimal
tsconfig.json
:test.ts
before importing:test.ts
after importing:OS
macos
Node version
any
Library version
stripe-node 17.4.0
API version
N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: