HLS: [path] cannot satisfy -package [package]

I’m trying to run HLS against a Stack project with resolver lts-24.8.

I’m attempting to configure this via an empty stack new, then editing stack.yaml to have resolver: lts-24.8. Doing this and running stack build works fine and dandy. When I try to attach my editor, however, I get the message:

  (GhcSession,NormalizedFilePath "/home/me/path/to/project/app/Main.hs")cannot
  satisfy -package project-0.1.0.0
  (use -v for more information)

This error also shows up in haskell-language-server-wrapper, but I can’t seem to determine which tool wants -v, because it doesn’t appear to be HLS.

Even stranger, taking an existing project that worked with HLS before and swapping out resolvers seems to work out of the box. I’m forced to conclude that I misconfigured something, but I have no idea what, nor do I know how to diagnose this.

Other possibly-pertinent info:

$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 9.10.2
$ stack --version
Version 3.7.1, Git revision 331f4880f1a33f1d39e14317dc9ecc6d3d6d617d x86_64 hpack-0.38.1
$ cabal --version
cabal-install version 3.16.0.0
compiled using version 3.16.0.0 of the Cabal library (in-tree)

Does stack repl work?

You can run haskell-language-server-wrapper --debug . to get more logs, which might be telling you a bit more.

The tool that suggests `-v` is GHC, but this is mostly an artefact of HLS being similar to a wrapper of GHC, so sometimes the error messages mention fixes for GHC instead of HLS.