-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TypeError: Cannot read property 'kind' of undefined #38383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Adding a
|
It looks like the line that is causing the crash itself is: // @ts-check
// this is a jest.config.js file
const config = makeConfig(/* ... */)
config.globals.__STORYBOOK__ = false // this line
// commenting it out prevents the crash
module.exports = config where the return type of |
We're seeing a similar issue, however, I can't seem to find the cause in our code. @Jessidhia did you add more console.log's in other parts to find the file/line? |
I've noticed quite similar (also, looking from stack trace - seemingly different one) issue. I thought that I will better file it as a dedicated issue - #38558. If it will turn out, that it is a duplicate, we can simply close the issue. |
@Jessidhia, can you post a precise repro? I tried a few things with the above snippet but can't get it to happen. |
@elibarzilay this happened to me today as I was setting up a new nextjs project. Basically if your checkout this example or
If you pin Typescript to 3.8.3 the error goes away. Cheers |
I'm not sure if I'm doing it right, but I tried the following two chunks in an empty directory:
and
Both ran without any errors... |
@elibarzilay try to change the typescript version to the latest in package.json before installing. |
@elibarzilay @Multiply yeah, it installs Typescript 3.9.3 when I setup the project. I get the error described above and as I said when I switch to 3.8.3 the error goes away. |
I'm using a Still no errors... |
To make this more controllable, I used docker. This is my build file (which doesn't get any errors):
|
When I switch to Nextjs version 9.4.2, Typescript version 3.9.3, I could no longer see the error |
Can confirm 9.4.2 of nextjs fixed it for us as well. |
I changed the docker setup to change the nextjs version to 9.4.1 and to 9.4.0, and still no error... |
I have the problem with typescript 3.9.3 and next 9.4.2 and ts-node 8.10.1. Switching to typescript 3.8.3 fixes the problem. |
I seem to have the same issue with next 9.4.2, typescript 3.9.3 and ts-node 8.10.1. |
Could be related to bad intersection types as documented here? https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#intersections-reduced-by-discriminant-properties |
@Hyokune @SeyedAlirezaFatemi @anthanh can you please provide concrete repro steps (ideally involving just a handful of TS/JS files and a config file)? We've tried a bunch of different configurations with the linked repo and haven't been able to cause the exception to occur. |
I reproduced the error in this repo: |
(@RyanCavanaugh, FWIW, I tried this one too, and still no failures.) |
@elibarzilay I opened @SeyedAlirezaFatemi repo in Gitpod and ran these commands: yarn && yarn build && yarn start After opening http://localhost:3000 with preview button in Open Ports tab I get the error. |
Ah, I never tried |
So, after digging through that pile of s...tuff, here's an actual minimal repro:
|
Bit late with the response, sorry. |
Had the fix been released? I still have the same issue with latest: next 9.4.4, typescript 3.9.5 and ts-node 8.10.2. node -v 12.4.0. |
This is still a problem with TypeScript 3.9.7. @elibarzilay's repro fails without any modifications. Unfortunately downgrading 3.8.3 is not an option for me because old versions ironically have another bug. Will we get this problem fixed? |
@elibarzilay Hi, Downgrading the TypeScript version from latest to |
Having the same issue with nextJS version 9.4.4 with Typescript version 3.9.7. |
@sourabh8003 IIRC, it was only included in 4.0. |
Sorry, I should have read more carefully. It's working on 4.0.0-dev.20200729. Thank you. |
I am still having this issue on node 14.17.0, typescript 4.2.4, ts-node 9.0.0
|
Same thing here, @SurjitSahoo . Previously it was working fine, but now throws that error. Did you find out a solution? |
I see this running |
TypeScript Version: 3.9.1-rc
Search Terms: typeerror kind
Code
Unknown
Expected behavior:
Compilation
Actual behavior:
Playground Link:
Unknown
Related Issues:
Unknown
The text was updated successfully, but these errors were encountered: