Skip to content

ESM vs CJS import woes #2639

Closed Answered by larssn
larssn asked this question in Q&A
Discussion options

You must be logged in to vote

So a workaround is doing:

import type { Bucket } from '@google-cloud/storage/build/cjs/src/bucket.d.ts'

And then adding the bucket.d.ts to paths in tsconfig's `compilerOptions:

"paths": {
  "@google-cloud/storage/build/cjs/src/bucket.d.ts": ["./node_modules/@google-cloud/storage/build/cjs/src/bucket.d.ts"]
}

This basically screams "fix me later".

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by larssn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant