syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Fatal error by some jsx / react ppx failures

Open amiralies opened this issue 3 years ago • 1 comments

Looking at react ppx's source there are some errors that are not raised via a location so the result is that just the ocaml excpetion is get printed by compiler.

@react.component
let make = React.null
Fatal error: exception Invalid_argument("react.component calls can only be on function definitions or component wrappers (forwardRef, memo).")

It'd be good if we handle these cases maybe in v4 ?

amiralies avatar Jun 17 '22 14:06 amiralies

Not sure it's about v3 vs v4 but certainly a good time to look into that. What's needed is a way to hook this up to the compiler's error mechanism. So the important aspect is the fact that the ppx is part of the compiler now so it is doable.

cristianoc avatar Jun 17 '22 15:06 cristianoc

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

stale[bot] avatar May 28 '23 15:05 stale[bot]