从 JS 转换到 ReScript 遇到的问题

我根据官网的 教程 尝试将我的一个 js 文件转换成 ReScript,但是马上遇到了问题:
我在 js 文件中使用了 模板字符串语法,似乎跟 Rescript 的 %%raw 起了冲突


然后我试着在 js 里的 “`” 符号前加上 "" 进行转义,错误提示消失了,然后我运行 “rescript build”,又出现了问题

无法进行下去了,在 %%raw 教程中也没有如何处理原生 js 的模板字符串语法的方法。请问这个问题该如何解决?
除此之外,当我运行代码格式化时,%%raw 中的 js 代码每行之间都增加了一行空行,这是为什么?

I’m not sure of the syntax you used to cause the issue you’re encountering with the compiler on your second screenshot but if you really don’t want to use simple string concatenation in your js snippet, the following syntax works: rescript playground.

This is because you are on windows, change the end line character to LF will fix the formatting issue. You can use wsl to write rescript code on windows, the ide is not worked very well on native windows, it has serious performance issue for middle or large project on native windows. And, the first problem is because %%raw only accept pure string, did you use used ${} in it?

Thank you! I used two string literal methods in js and forgot there was a third one.

Thanks! Changing the end line character to LF did fix the weird formatting issue. The first problem was also solved after a reminder.