Skip to content

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

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
mediremi opened this issue Jun 5, 2025 · 3 comments · May be fixed by #7540
Open

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

mediremi opened this issue Jun 5, 2025 · 3 comments · May be fixed by #7540
Assignees

Comments

@mediremi
Copy link
Contributor

mediremi commented Jun 5, 2025

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)

@nojaf
Copy link
Collaborator

nojaf commented Jun 6, 2025

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

@nojaf nojaf self-assigned this Jun 6, 2025
@zth
Copy link
Collaborator

zth commented Jun 6, 2025

Feels like some loc's have gone missing perhaps.

@nojaf
Copy link
Collaborator

nojaf commented Jun 6, 2025

Yes, I bet this is similar too #7533

@nojaf nojaf linked a pull request Jun 6, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants