rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

"Missing required props" error does not show line number when component has `children` prop

Open mediremi opened this issue 6 months ago • 3 comments

ReScript version v12.0.0-alpha.14's "Missing required props" error does not show line numbers when the component has a children prop:

module Wrapper = {
  @react.component
  let make = (~value: 'value, ~children: React.element) => {
    <div> {children} </div>
  }
}

module SomeComponent = {
  @react.component
  let make = () => {
    <Wrapper>
      <div> {""->React.string} </div>
    </Wrapper>
  }
}
FAILED: Foo.cmj

  We've found a bug for you!
  /home/mediremi/test/Foo.res

  The component <Wrapper /> is missing these required props:
   value

(Playground link)

mediremi avatar Jun 05 '25 17:06 mediremi

I'll try to check your issues over the weekend. It most likely related to jsx ast.

nojaf avatar Jun 06 '25 07:06 nojaf

Feels like some loc's have gone missing perhaps.

zth avatar Jun 06 '25 07:06 zth

Yes, I bet this is similar too https://github.com/rescript-lang/rescript/pull/7533

nojaf avatar Jun 06 '25 08:06 nojaf