question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error build project with error Object is of type 'unknown'.

See original GitHub issue

I want build this project.

  1. yarn install
  2. yarn build

And i getting this error

src/browser.ts:307:20 - error TS2571: Object is of type 'unknown'.

307       term.writeln(err.message);
                       ~~~

src/fileSystem.ts:171:15 - error TS2571: Object is of type 'unknown'.

171           if (err.name === 'TypeMismatchError') {
                  ~~~

src/fileSystem.ts:184:13 - error TS2571: Object is of type 'unknown'.

184         if (err.name === 'TypeMismatchError') {
                ~~~

src/test.ts:134:25 - error TS2571: Object is of type 'unknown'.

134               message = err.message;
                            ~~~


Found 4 errors.

Howe can i resolve this error ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RReversercommented, Oct 22, 2021

Yeah this looks good IMO.

0reactions
zababurinsvcommented, Oct 22, 2021

I see. In that case, reverting to err: any sounds good for now. Please send a PR.

I create new commit with type Error

https://github.com/GoogleChromeLabs/wasi-fs-access/compare/main...zababurinsv:zb?expand=1

It is ok ? If the first option is better, then I’ll leave it and send a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object is of type 'unknown' typescript generics
I got this error in the catch block. After debugging for a while I came to know that starting typescript v4.0, catch clause...
Read more >
TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >
TypeScript: Playground Example - Unknown in Catch
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
Read more >
Announcing TypeScript 4.4
Types make your intentions explicit, and tools can read and understand them to catch errors before you even run your code.
Read more >
Handling errors like a pro in TypeScript | by Kolby Sisk
error is type unknown , so we can't perform any actions with error until we cast it to a new type, or narrow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found