Skip to content

Support multiple TypeScript entry points #219

@tobalsgithub

Description

@tobalsgithub

Ran into an issue compiling the type definitions in typescript in a node environment. I'm using this command tsc --outDir bld --module commonjs --target ES2016 to compile and I hit this error

node_modules/avsc/types/index.d.ts(148,41): error TS2304: Cannot find name 'Blob'.

Typescript: 2.9.2
Node: 8.11.3

It appears that Blob is a global exposed on browsers but not available in a node environment.

This issue discusses the same problem for a different library. DefinitelyTyped/DefinitelyTyped#12044

I'd make a PR to fix this, but I don't actually know what the right solution is here. It feels like an anti-pattern to have the type definitions depend on something globally available only in certain environments, but I'm not well versed enough in typescript to know how to handle such a situation.

For now, I've changed my compilation command to tsc --outDir bld --module commonjs --target ES2016 --skipLibCheck which gets me around the problem.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions