Giter VIP home page Giter VIP logo

Comments (8)

alexpls avatar alexpls commented on July 17, 2024 39

ReadableStream and File types will not be imported by default unless the dom library has been included in your TypeScript config.

@AliakseiBychyk, try adding this to your tsconfig.json:

{
  ...
  "compilerOptions": {
    "lib": [
      ...
      "dom"
    ]
  }
}

As a side note, I'm not convinced that using the dom library's ReadableStream was the intention here, since the rest of this package uses the NodeJS.ReadableStream type instead. I'm happy to make a PR to change this to NodeJS.ReadableStream if you agree.

from node-sdk-core.

dpopp07 avatar dpopp07 commented on July 17, 2024 1

@alexpls I think that's a good idea, feel free to open that PR. Thanks

from node-sdk-core.

alexpls avatar alexpls commented on July 17, 2024 1

Glad to hear it's working @AliakseiBychyk!

@dpopp07 I've opened up a PR to use NodeJS.ReadableStream instead of DOM ReadableStream.

I reckon this issue can be closed now, right?

from node-sdk-core.

dpopp07 avatar dpopp07 commented on July 17, 2024 1

Resolved with #13

Thanks @alexpls

from node-sdk-core.

dpopp07 avatar dpopp07 commented on July 17, 2024

Interesting, I've not see this problem. What version of TypeScript are you using?

from node-sdk-core.

AliakseiBychyk avatar AliakseiBychyk commented on July 17, 2024

TypeScript v.3.4.2
I found that someone already described the similar issue on Stackoverflow: https://stackoverflow.com/questions/55340159/receiving-ts2304-cannot-find-name-file-ts2304-cannot-find-name-readablest

Previously I used 'watson-developer-cloud' v.3.18.1 it had build-in lib, but newer version 4.0.1 has dependency on 'ibm-cloud-sdk-core'.

from node-sdk-core.

dpopp07 avatar dpopp07 commented on July 17, 2024

@AliakseiBychyk I tried installing v3.4.2 and creating a sample project depending on v4.0.1. I am not getting any errors. Will you list some specific steps I can follow to reproduce this issue?

from node-sdk-core.

AliakseiBychyk avatar AliakseiBychyk commented on July 17, 2024

@alexpls Thanks, actually --lib dom in compiler options fixed the problem.
Since my app runs only on server-side, I didn't include 'dom' to the ts compiler options. It seems to me reasonable to change ReadableStream type to NodeJS.ReadableStream.

from node-sdk-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.