-
Notifications
You must be signed in to change notification settings - Fork 188
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
Sourcemaps for .re (Reason) files #716
Comments
Last time I checked the source maps (even for .ml) need a little more work to be generally usable. But for this particular bug, I'm surprised it's happening. I saw .re sourcemaps working somewhat correctly a long time ago but that was before Dune was the one generating them. The issue is that Dune first generates a .ml file (which is just a raw serialized AST that happens to have an .ml extension) to feed to ocamlc. Normally you'd just supply the .re file as input directly to ocamlc. Even so, I'm surprised because I would think that the locations embeded in the output |
@jordwalke Thanks. I confirm I have tested the same project but using I'll investigate the fix you mention. |
Update: I started a simpler project that includes just the bare configuration of jsoo, dune and esy, and source maps in that case work beautifully: So it seems to be an isolated issue of the original repo I mentioned in the description. That repo includes a bunch of ppxs, not sure if it might be related. |
Very interesting! yeah, I wonder if the ppx's are somehow dropping the location information or producing the wrong format of intermediate file. But I noticed your simpler project has a ppx |
I believe this is an issue with how dune handles some reason files. Compilation steps go as follow:
Passing args cc @rgrinberg, @diml |
Great find. I imagine that would also end up causing other issues too. |
Hmm, actually maybe ppxlib is trying to be too clever here. When the filename read from the marshaled ast file doesn't match what ppxlib thinks the filename is, it rewrites the AST with the new name. At least, we shouldn't rewrite the AST unless |
Ppxlib has been fixed. Closing. |
thanks |
I'm setting up a small project to learn about js_of_ocaml with incr_dom, and using the Reason syntax (https://github.com/jchavarri/incr_dom_reason/).
Everything works 🎉 but the sourcemaps for Reason files seem to be broken:
They seem to point to the
.re.ml
files that are generated on the build folder.Is there any configuration that I can use to fix this? cc @jordwalke
The text was updated successfully, but these errors were encountered: