davesnx/styled-ppx

Bug with rescript compilation

ashton opened this issue · 11 comments

ashton commented

Hey! I've installed "@davesnx/styled-ppx": "^0.50.0", and when trying to run my project using rescript (10.1.4) with rescript-react (0.11.0), it shows the following error
image

It seems that the compilation of this line is generating triple quotes and thus, an invalid syntax in the .bs.js file.
Cursor_and_less

In the meantime, those can be fixed by manually escaping the quotes

ashton commented

Which quotes exactly? (version 0.40.1 is working perfectly)

Which quotes exactly?

For example; case """ : to case "\"":

(version 0.40.1 is working perfectly)

We shall investigate and fix what could be causing the regression. Thanks for the report

ashton commented

For example; case """: to case "\"":

but those are generated files, everytime I run a npm install this would be overwritten

ashton commented

Also, not sure if it's related, but the PPX itself is not being recognized by rescript:
image

@lubegasimon Do you want me to open another issue?

Also, not sure if it's related, but the PPX itself is not being recognized by rescript: image

@lubegasimon Do you want me to open another issue?

Yes, though it seems something is missing out during the installation. Does this -- https://styled-ppx.vercel.app/getting-started guide help?

ashton commented

I think I followed what the getting started said, not sure if something is off because is not a new installation but an upgrade:

image

It seems that the compilation of this line is generating triple quotes and thus, an invalid syntax in the .bs.js file

No, one occurrence is at

| {js|"|js} | {js|'|js} -> value

I believe the issue has been fixed in main, but didn't release a npm package yet. Let me try to reproduce and double-check ReScript and release a 0.51

Updated the https://github.com/davesnx/try-styled-ppx repository with ReScript 10 and styled-ppx 0.53 working nicely