Git Product home page Git Product logo

Comments (6)

spencerbug avatar spencerbug commented on August 22, 2024

Update: I fixed it by changing all the try catch block errors to be explicitly cast as type 'any' instead of 'unknown'.

try
..
catch(error)

becomes

try
..
catch(error:any)

Although I'm not sure if this is the right approach, I'm not an expert in typescript. I think they changed something in typescript 4 that is requiring explicit type specification of try catch error: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables

from internet-identity.

nmattia avatar nmattia commented on August 22, 2024

Hi, would replacing :any with :Error work too? What commit did you use? I'm currently fixing some issues related to dfx 0.8.1 as well.

from internet-identity.

nmattia avatar nmattia commented on August 22, 2024

@spencerbug are you still having this issue?

from internet-identity.

spencerbug avatar spencerbug commented on August 22, 2024

@nmattia replacing :any with :Error doesn't work. I'll make a pull request from fork.
I'm not familiar with all of dfinity's processes for pull requests, I assume there are tests that need to run, maybe let me know what I need to do. Glad to help.
catch(error) defaults to type "unknown" which can't be treated as strings, for printing, unless they are typecast to something more specific.
Here: #476

from internet-identity.

nmattia avatar nmattia commented on August 22, 2024

Fixed in #476

from internet-identity.

nmattia avatar nmattia commented on August 22, 2024

Thanks @spencerbug !

from internet-identity.

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.