Closed safwansamsudeen closed 1 year ago
I wouldn't worry about the lints, those don't actually kill the build. Is there anything else in the output that would suggest why the command failed?
My apologies, this comes before the lint:
Done in 1.3s
Running task for: aquascope-editor
build
Build complete.
................................................................................
check
src/editor-utils/boundaries.tsx:182:14 - error TS2345: Argument of type 'Timeout' is not assignable to parameter of type 'SetStateAction<number | undefined>'.
182 setTimer(setTimeout(() => setAnimating(false), 500));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in src/editor-utils/boundaries.tsx:182
................................................................................
lint
...
Oh, that's a strange. I don't know why you're getting a type error. I can't reproduce it locally. Maybe Graco is using a weird version of Typescript or something.
What OS and shell are you using?
ZSH, macOS Ventrura. npm
: 8.19.3, node
: 18.12.1.
Ok, I will investigate. In the mean time, just do whatever's needed to fix the type error (feel free to cast something to any
as a temporary hack).
What's happening here is the type of setTimeout
is getting inferred as the Node type, instead of the React type. See StackOverflow.
I can confirm that changing the function to window.setTimeout
works, a more elegant solution is probably to exclude the Node types from the tsconfig
because we don't need them. E.g.,
{
"compilerOptions": {
"types": ["react-native", "jest"]
}
}
@gavinleroy your solution was correct. I wonder why this didn't happen to @willcrichton... may I PR this?
However, changing tsconfig
didn't work in my case - raising something about not finding the entry type "react-native". I changed it to react, but that too raised a similar error.
Many thanks!
This issue was fixed by #96, we explicitly specified that the timeout be set on the window.
First, we have to install
cargo-make
. After that, the last two lines are meant to be called from the root dir, but the third last linecd
s into the root directory - perhaps we should change the instructions like this:Apart from that, when I try to run
graco prepare
, the following error comes: (...
used to denote the parent folder ofaquascope
)There exists no
--fix
option. How can I resolve this?