Skip to content

hls crashes after Can't find interface-file declaration for variable errors #2113

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

Closed
marklemay opened this issue Aug 18, 2021 · 6 comments
Closed
Labels
os: macos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@marklemay
Copy link

I am getting the "The Haskell (...) server crashed 5 times in the last 3 minutes. The server will not be restarted." possibly because "Request textDocument/codeAction failed".

I disabled almost all optional plugin functionality and generated this log

Unfortunately I cannot make a simple project that exercises this error. I can share a private repo where it seems to always happen if that helps. There may be different errors that make this hard to reproduce.

according to visual studio code:

Version: 1.55.1 (Universal)
Commit: 08a217c4d27a02a5bcde898fd7981bda5b49391b
Date: 2021-04-07T18:22:52.186Z (4 mos ago)
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 19.4.0

follow up to: haskell/vscode-haskell#429

@jneira
Copy link
Member

jneira commented Aug 18, 2021

Hi, thanks for the bug report, the log coaains interesting info:

GHC error in desugarer lookup in Ghci1:
  attempting to use module ‘main:Dynamic.Ast’ (/Users/xxx/dtest/src/Dynamic/Ast.hs) which is not loaded
GHC error in desugarer lookup in Ghci1:
  Can't find interface-file declaration for variable $tcExp
    Probable cause: bug in .hi-boot file, or inconsistent .hi file
    Use -ddump-if-trace to get an idea of which file caused the error

hls uses a way to load files similar to ghci, does cabal repl src/Dynamic/Ast.hs works?
(btw i am gonna translate the issue to the haskell-language-server as it seems to be an issue with the server)

@jneira jneira transferred this issue from haskell/vscode-haskell Aug 18, 2021
@jneira jneira added os: macos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. type: setup labels Aug 18, 2021
@jneira
Copy link
Member

jneira commented Aug 18, 2021

The error was produced in hie: haskell/haskell-ide-engine#1100

@jneira
Copy link
Member

jneira commented Aug 18, 2021

@marklemay do you use template haskell in the problematic files?

@michaelpj
Copy link
Collaborator

I have been meaning to open an issue like this, I often see a similar error.

@marklemay
Copy link
Author

marklemay commented Aug 19, 2021

@jneira
cabal repl src/Dynamic/Ast.hs seems to work though it doesn't go to the correct module. in the repl :l src/Dynamic/Ast.hs takes me there without errors

Ast.hs may be coming up in the errors because that is the only file I opened from the project in the editor.

I don't believe there is template Haskell in that file specifically, though the project makes use of generics and some temples.

@jneira jneira changed the title "The Haskell (...) server crashed 5 times in the last 3 minutes. The server will not be restarted." possibly because "Request textDocument/codeAction failed" hls crashes after Can't find interface-file declaration for variable errors Jan 31, 2022
@michaelpj
Copy link
Collaborator

Closing as old and quiet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: macos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants