Hi
Wrong import is generated on windows 11, rescript compiler - 10.1.2
Module not found: Error: Can’t resolve ‘rescript/lib/es6\curry.js’
This should have been ‘rescript/lib/es6/curry.js’
-sriky27
Hi
Wrong import is generated on windows 11, rescript compiler - 10.1.2
Module not found: Error: Can’t resolve ‘rescript/lib/es6\curry.js’
This should have been ‘rescript/lib/es6/curry.js’
-sriky27
Can you upload a minimal reproduction example?
Hi @yawaramin
module CounterMessage = {
@react.component
let make = (~count, ~username=?) => {
let times = switch count {
| 1 => "once"
| 2 => "twice"
| n => Belt.Int.toString(n) ++ " times"
}
let name = switch username {
| Some("") => "Anonymous"
| Some(name) => name
| None => "Anonymous"
}
<div> {React.string(`Hello ${name}, you clicked me ` ++ times)} </div>
}
}
module App = {
@react.component
let make = () => {
let (count, setCount) = React.useState(() => 0)
let (username, setUsername) = React.useState(() => "Anonymous")
<div>
{React.string("Username: ")}
<input
type_="text"
value={username}
onChange={evt => {
evt->ReactEvent.Form.preventDefault
let username = (evt->ReactEvent.Form.target)["value"]
setUsername(_prev => username)
}}
/>
<button
onClick={_evt => {
setCount(prev => prev + 1)
}}>
{React.string("Click me")}
</button>
<button onClick={_evt => setCount(_ => 0)}> {React.string("Reset")} </button>
<CounterMessage count username />
</div>
}
}
This very example from the rescript playground is generating the following import on windows
import * as Curry from "rescript/lib/es6\curry.js";
Instead of
import * as Curry from "rescript/lib/es6/curry.js";
It would be good to know more about this.
To cut on the communication noise: we can use a one-line example:
let foo = f => f()
Is this new in 10.1.2?
And is that path a problem?
If so, it looks like nobody on Windows was ever able to compile anything that uses curry, which would be surprising if we never heard a report before.
Hi @cristianoc
Apologies for delayed response. Winter holidays affected the responses. I could not get hold of my colleague. I tried on a windows 11 laptop I had, it was working fine.
He will be back on Monday. I will ask his configuration.
-Sriky