Construct 3 r440.2

You're viewing a single comment in a conversation. View all the comments
  • 4 Comments

  • Order by
  • Type inference still doesn't work correctly if you switch to TypeScript and editor thinks object is nullable when you specifically check for that. In VScode there is not errors (i use default tsconfig). If it was just warning, it would've been bearable, but it literally doesn't allow me to preview the project :/

    Imgur

      • [-] [+]
      • UpvoteUpvote 1 DownvoteDownvote
      • Ashley's avatar
      • Ashley
      • Construct Team Founder
      • 1 points
      • *
      • (2 children)

      Those are TypeScript errors. You might need to do something like add '!' to assert something is not null.

      • I mean, yes, i can do that. But that's a hack basically and that's annoying. And it will hide actual null errors when they arise. Problem is that Construct's TypeScript can't deduce types from the code, and null check doesn't do anything, what's the point then?. So because of this I have to go through entirety of my code and add this hacks everywhere to even start the project. Feels like a downgrade for me, not an upgrade.

          • [-] [+]
          • UpvoteUpvote 1 DownvoteDownvote
          • Ashley's avatar
          • Ashley
          • Construct Team Founder
          • 1 points
          • (0 children)

          It's the industry-standard version of TypeScript, it's not "Construct's TypeScript". I think this is just how TypeScript works.