Skip to content

Installing @aws-sdk/core or @aws-sdk/types tells TS that NodeJS globals are available, which can make TS ignore potential errors in browsersΒ #6413

@bogdanailincaipnt

Description

@bogdanailincaipnt

Checkboxes for prior research

Describe the bug

Installing @aws-sdk/core or @aws-sdk/types tells TS that NodeJS globals are available, which can make TS ignore potential errors in browsers.

Related issue and more info, context: aws-amplify/amplify-js#11736

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

Chrome: 128.0.6613.84

Reproduction Steps

https://stackblitz.com/edit/vitejs-vite-gmzgbg?file=src%2Fmain.ts

  1. Wait for npm install to finish.
  2. Note that when hovering on process.env, TS shows us that NodeJS globals are available.
  3. If you comment out the line that does import '@aws-sdk/core';, the errors show up. They should show up either way, because I've specified "types": [], in tsconfig.json, so global types from @types/node should not be included, even though I've installed the @types/node package.

Observed Behavior

See aws-amplify/amplify-js#11736

Expected Behavior

See aws-amplify/amplify-js#11736

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions