Skip to content
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

TypeError: Cannot read properties of undefined (reading 'fileInfo') #6234

Closed
judej opened this issue Aug 6, 2024 · 5 comments
Closed

TypeError: Cannot read properties of undefined (reading 'fileInfo') #6234

judej opened this issue Aug 6, 2024 · 5 comments
Assignees
Labels
fixed in next version (pyright) A fix has been implemented and will appear in an upcoming version fixed in next version (release) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet

Comments

@judej
Copy link
Contributor

judej commented Aug 6, 2024

Seeing several of these on the insiders release:: 2024.7.103 pyrightVersion: 1.1.373

TypeError: Cannot read properties of undefined (reading 'fileInfo')
at fileInfo /src/analyzer/analyzerNodeInfo.ts#L177'>pyright-internal/src/analyzer/analyzerNodeInfo.ts:177:17
at getFileInfo /src/analyzer/program.ts#L2035'>pyright-internal/src/analyzer/program.ts:2035:46
at callback /src/common/logTracker.ts#L61'>pyright-internal/src/common/logTracker.ts:61:19
at log /src/analyzer/program.ts#L1895'>pyright-internal/src/analyzer/program.ts:1895:32
at callback /src/analyzer/typeEvaluator.ts#L636'>pyright-internal/src/analyzer/typeEvaluator.ts:636:19
at callback /src/common/timing.ts#L40'>pyright-internal/src/common/timing.ts:40:19
at runWithCancellationToken /src/analyzer/program.ts#L1045'>pyright-internal/src/analyzer/program.ts:1045:40
at _runEvaluatorWithCancellationToken /src/analyzer/program.ts#L620'>pyright-internal/src/analyzer/program.ts:620:20
at analyze /src/analyzer/analysis.ts#L57'>pyright-internal/src/analyzer/analysis.ts:57:32
at this /src/backgroundAnalysisBase.ts#L508'>pyright-internal/src/backgroundAnalysisBase.ts:508:12
at handleResumeAnalysis /src/backgroundAnalysisBase.ts#L501'>pyright-internal/src/backgroundAnalysisBase.ts:501:13
at None src/backgroundAnalysis.ts#L416'>pylance-internal/src/backgroundAnalysis.ts:416:28
at handleAnalyze /src/backgroundAnalysisBase.ts#L351'>pyright-internal/src/backgroundAnalysisBase.ts:351:21
at None src/backgroundAnalysis.ts#L404'>pylance-internal/src/backgroundAnalysis.ts:404:28
at onMessage /src/backgroundAnalysisBase.ts#L670'>pyright-internal/src/backgroundAnalysisBase.ts:670:24
    at func (node:<REDACTED: user-file-path>:825:20)
    at func (node:<REDACTED: user-file-path>:23:28)
@judej judej added the bug Something isn't working label Aug 6, 2024
@erictraut
Copy link
Contributor

erictraut commented Aug 6, 2024

@judej, this is in Pylance-specific code and it specifically applies to notebooks. I think Heejae added this code originally. Please transfer this issue to the pylance-release project and triage/prioritize as you see fit.

@debonte debonte removed the bug Something isn't working label Aug 6, 2024
@debonte debonte transferred this issue from microsoft/pyright Aug 6, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Aug 6, 2024
@KacieKK
Copy link
Contributor

KacieKK commented Aug 6, 2024

Hey @erictraut, I was trying to find the root cause but couldnt. Could you share why do you think this is notebook related? Appreciate it.

@erictraut
Copy link
Contributor

If you look at the stack crawl, the frame right before the crash indicates that it's in program.ts at line 2035 where there's a call to getFileInfo. If you look at that code, it's in code that's looping through "chained files". Chained files were added by the pylance team to support notebooks. I don't have full visibility into who made these changes because "blame" shows all pylance contributions as coming from PylanceBot. Either Rich or HeeJae should know more about chained files and how they are intended to work.

@heejaechang
Copy link
Contributor

it might be due to people using mismatched LSP packages. they need to use the latest prelease python extension with pylance prerelease (2024.7.104). LSP package pylance used to depend on had serious notebook bug so we downgraded to old version on 104 for both pylance/python extension. if user uses mismatched version (using old python extension with the latest pylance), python extension side notebook client code will still has notebook bug and that could mess up our side as well.

@luabud is there a way to see python extension version used for the crash?

@KacieKK KacieKK added fixed in next version (release) A fix has been implemented and will appear in an upcoming version fixed in next version (pyright) A fix has been implemented and will appear in an upcoming version labels Aug 9, 2024
@bschnurr
Copy link
Member

bschnurr commented Aug 12, 2024

This issue has been fixed in prerelease version 2024.8.101, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (pyright) A fix has been implemented and will appear in an upcoming version fixed in next version (release) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

6 participants