oak-graphql
oak-graphql copied to clipboard
Multiple errors when building Readme Sample
Hello,
I get multiple errors when running sample provided in Readme. I run it using deno run --allow-net app.ts
Errors are like this:
TS7006 [ERROR]: Parameter 'info' implicitly has an 'any' type.
return (root, args, ctx, info) => {
~~~~
at https://deno.land/x/oak_graphql/graphql-tools/schema/addCatchUndefinedToSchema.ts:6:28
A total of 53 errors
give me more details? such as which version are you using etc...
can you try to reload all modules? deno run --reload https://deno.land/x/oak/mod.ts deno run --reload https://deno.land/x/oak_graphql/mod.ts
deno --version
outputs
deno 1.1.3
v8 8.5.216
typescript 3.9.2
Running --reload commands do not improve.
Allowing implicit any in tsconfig reduces de number of errors and it only gets:
error: TS2345 [ERROR]: Argument of type 'RegExp' is not assignable to parameter of type 'never'.
pathSegments.push(new RegExp(segment, flags));
~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/[email protected]/path/_globrex.ts:96:29
TS2352 [ERROR]: Conversion of type 'undefined' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
add(type as string);
~~~~~~~~~~~~~~
at https://deno.land/[email protected]/path/_globrex.ts:139:15
TS2345 [ERROR]: Argument of type 'any' is not assignable to parameter of type 'never'.
ext.push(c);
^
at https://deno.land/[email protected]/path/_globrex.ts:158:18
TS2345 [ERROR]: Argument of type 'any' is not assignable to parameter of type 'never'.
ext.push(c);
^
at https://deno.land/[email protected]/path/_globrex.ts:167:18
TS2345 [ERROR]: Argument of type 'any' is not assignable to parameter of type 'never'.
ext.push(c);
^
at https://deno.land/[email protected]/path/_globrex.ts:179:20
TS2345 [ERROR]: Argument of type 'any' is not assignable to parameter of type 'never'.
ext.push(c);
^
at https://deno.land/[email protected]/path/_globrex.ts:194:20
TS2345 [ERROR]: Argument of type 'any' is not assignable to parameter of type 'never'.
ext.push(c);
^
at https://deno.land/[email protected]/path/_globrex.ts:265:18
TS2345 [ERROR]: Argument of type 'RegExp' is not assignable to parameter of type 'never'.
pathSegments.push(new RegExp(segment, flags));
~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/[email protected]/path/_globrex.ts:317:23
TS2345 [ERROR]: Argument of type 'T' is not assignable to parameter of type 'never'.
common.push(A[reverse ? A.length - i - 1 : i]);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/[email protected]/testing/diff.ts:31:19
TS2322 [ERROR]: Type 'DiffType.removed | DiffType.added' is not assignable to type 'never'.
Type 'DiffType.removed' is not assignable to type 'never'.
type: swapped ? DiffType.removed : DiffType.added,
~~~~
at https://deno.land/[email protected]/testing/diff.ts:111:11
TS2322 [ERROR]: Type 'T' is not assignable to type 'never'.
value: B[b],
~~~~~
at https://deno.land/[email protected]/testing/diff.ts:112:11
TS2322 [ERROR]: Type 'DiffType.removed | DiffType.added' is not assignable to type 'never'.
Type 'DiffType.removed' is not assignable to type 'never'.
type: swapped ? DiffType.added : DiffType.removed,
~~~~
at https://deno.land/[email protected]/testing/diff.ts:117:11
TS2322 [ERROR]: Type 'T' is not assignable to type 'never'.
value: A[a],
~~~~~
at https://deno.land/[email protected]/testing/diff.ts:118:11
TS2322 [ERROR]: Type 'DiffType.common' is not assignable to type 'never'.
result.unshift({ type: DiffType.common, value: A[a] });
~~~~
at https://deno.land/[email protected]/testing/diff.ts:122:26
TS2322 [ERROR]: Type 'T' is not assignable to type 'never'.
result.unshift({ type: DiffType.common, value: A[a] });
~~~~~
at https://deno.land/[email protected]/testing/diff.ts:122:49
TS2322 [ERROR]: Type 'null' is not assignable to type 'Error'.
return error;
~~~~~~~~~~~~~
at https://deno.land/[email protected]/testing/asserts.ts:409:3
TS2322 [ERROR]: Type 'null' is not assignable to type 'Error'.
return error;
~~~~~~~~~~~~~
at https://deno.land/[email protected]/testing/asserts.ts:453:3
TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'never'.
items.push(formatValue(array[i], seenValues));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/oak_graphql/graphql-tools/utils/inspect.ts:81:16
TS2345 [ERROR]: Argument of type '"... 1 more item"' is not assignable to parameter of type 'never'.
items.push('... 1 more item');
~~~~~~~~~~~~~~~~~
at https://deno.land/x/oak_graphql/graphql-tools/utils/inspect.ts:85:16
TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'never'.
items.push(`... ${remaining.toString(10)} more items`);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/oak_graphql/graphql-tools/utils/inspect.ts:87:16
TS2345 [ERROR]: Argument of type 'any' is not assignable to parameter of type 'never'.
fieldErrors.push(error);
~~~~~
at https://deno.land/x/oak_graphql/graphql-tools/utils/errors.ts:69:24
Found 21 errors.
This is weird, I've tested all ENV and it's working fine. Moreover, this project does not need to have tsconfig file for the execution at all.
can you provide me tsconfig.json file as well?
Weird in fact.
tsconfig.json is as follows
{
"compilerOptions": {
"noImplicitAny": false
}
}
If I remove it I get, besides the errors above, all the errors regarding implicty any.
I have checkt it on another computer, and same errors :(
By the way, it's linux (Ubuntu 20.04)
I have ran the same code on a dockerized container, to avoid any side-effects and it works, and thus, error must be related with my environment (quite weird this side effect). It's safe to close this issue.
On the directory there was a node-modules folder related to vscode plugin configuration. I have removed that folder and now it works. Any chance there is some kind of weird interaction?
The most strange thing is error messages are coming from deno std lib too. I just want to make sure that the standalone oak framework is working.
hey, i'm having a lot of errors. everything has stopped working. these are deno std library errors.
error: TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/[email protected]/path/win32.ts:911:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/[email protected]/path/posix.ts:433:18
but these errors are only appearing when oak_graphql is used. the example from oak's readme works but the one from oak_graphql doesn't
I think it's related to this issue
it means you're using the wrong version of oak for 1.1.3 version of deno
So which versions of deno
, oak
and oak-graphql
should I use?