Skip to content

Error "Missing dependency …… in search path" #1087

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

Open
remitbri opened this issue Apr 29, 2025 · 2 comments
Open

Error "Missing dependency …… in search path" #1087

remitbri opened this issue Apr 29, 2025 · 2 comments

Comments

@remitbri
Copy link

Hello

I'm using ReScript 11.1.4 and extension 1.63.6

I have several modules in the style of

module FooBar = {
  let make = React.lazy_(() => Js.import(FooBar.make))
}

module App = {
  @react.component
  let make = () => {
    <div>
      {React.string("Foobar: ")}
      <FooBar />
    </div>
  }
}

where FooBar is another (existing) module.

The compiler running in the terminal is perfectly happy. If I open the module containing the code above in VSCode it's fine. But as soon as I edit the module, I've got an error from the extension displaying "Missing dependency FooBar in search path" at the beginning of the file. If I reload the module, no extension error until I edit the module. And again, the compiler in the terminal shows zero problem.

It's more an annoying than a stopping issue, sure (it took me, err, months to open the issue)

@zth
Copy link
Collaborator

zth commented Apr 29, 2025

So you've narrowed it down to when there are "overlapping" modules like that?

(the issue has to do with incremental typechecking)

@remitbri
Copy link
Author

Indeed. In fact, I used to have just in the App module when I was still using ReScript v10

module App = {
  @react.component
  let make = () => {
    <div>
      {React.string("Foobar: ")}
      <LoadableFooBar />
    </div>
  }
}

and in the LoadableFooBar

module type FooBarType = module type of FooBar

@val
external FooBarType: module(FooBarType) = "undefined"

include unpack(FooBarType)

@val
external import: (@as("./FooBar.mjs") _, unit) => Js.Promise.t<'a> = "import"

let make = ReactLazy.make(() =>
  import() |> Js.Promise.then_((module(FooBar: FooBarType)) =>
    Js.Promise.resolve({"default": FooBar.make})
  )
)

and it was rewritten to the code at the beginning when I moved to v11, and that's when the extension error appeared
(…I think. It might have appeared at a later extension update. Sorry!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants