Closed jonahsnider closed 4 years ago
I've also experienced this issue. Having looked into closed tickets, this appears to have been an issue that was previously resolved.
A temporary work-around is to put this into a general "global types" file. With some tweaks, it can be placed directly in test files as well.
declare interface SymbolConstructor {
readonly observable: symbol;
}
See the discussion in https://github.com/avajs/ava/issues/2212. A fix is in progress at https://github.com/avajs/ava/pull/2308.
Oh wait — reading more closely, is this something that started happening with TypeScript 3.7.4?
Issue is still present with TypeScript v3.7.3
and v3.7.2
.
I'd be happy to ship a 2.4.1 release if necessary, but I can't tell from the feedback here whether this is something that stopped working recently or has always been a problem. I haven't encountered it myself.
@znorman-harris*, do you have any insight here?
Perhaps this had something to do with the typings for Node @types/node
and not the TypeScript compiler?
Perhaps this had something to do with the typings for Node
@types/node
and not the TypeScript compiler?
Yes, maybe. Hopefully folks can work around that by pinning an older version.
I can verify that this happens with
node @ v12.7.0
ava @ 2.4.0
@types/node @ 13.1.4
But does not at
node @ v12.7.0
ava @ 2.4.0
@types/node @ 12.12.24
It seems to be a @types/node@v13.0 update
I don't understand this change to make sense of what is going on, but it seems adding
import Symbol_observable from 'symbol-observable';
to avajs/index.d.ts
resolves the tsc
error.
For my case it seems to work, not sure if that is however a proper fix.
OK so it may indeed be @types/node
. That's not the best fix, but it looks like this can be worked around.
AVA 3 beta will be out soon (unofficially, I'm too tired to write the release notes) which does away with this symbol type altogether.
@novemberborn this was something that came up recently for me. I remember seeing it a while back, but dismissed it when it didn't reappear.
Considering there is a workaround I'm good and can wait until the next release!
npm i -D -E ava@next
will give you the next release, but I haven't yet documented the breaking changes so use at your own peril 😉
I'm getting this error as well. Having a really hard time getting tsconfig
{ "exclude": [] }
syntax to ignore my test files.
Should this issue be opened again? It seems it's not yet really resolved.
Got a fix for now:
tsconfig.json:
{
"exclude": ["**/__tests/*", "**/testing/*"],
"include": ["./src"],
"compilerOptions": {
// code omitted....
}
}
The issue actually lies with Typescript here... The typescript file where global Symbol variable and SymbolConstructor is declared doesn't have observable as one of it's properties. It feels kinda crappy modifying that file...
@tjmosia this has been resolved with AVA 3.
Description
When compiling with TypeScript there is a typings error which makes the TypeScript compiler exit with exit code 2. The code still gets compiled but my build CI fails because of the exit code. This happens on the latest AVA version if AVA is being compiled at all by TSC.
Error Message & Stack Trace
Command-Line Arguments
Run this to compile my example repo.
Relevant Links
tsc index.ts
Environment
TypeScript v3.7.4 Node.js v12.14.0 linux 4.4.0-18362-Microsoft AVA v2.4.0 npm v6.13.4