You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ npm run res:build
> [email protected] res:build
> rescript
>>>> Start compiling
Dependency Finished
rescript: [9/9] src/Demo.cmj
FAILED: src/Demo.cmj
We've found a bug for you!
/home/carl/git/rescript-await-module/await-module-test/src/Demo.res:2:24-32
1 │ let main = async () => {
2 │ module Utils = await MathUtils
3 │ let twoPlusTwo = Utils.add(2, 2)
4 │ Js.log(twoPlusTwo)
Invalid argument: Dynamic import requires a module or module value that is a file as argument. Passing a value or local module is not allowed.
FAILED: cannot make progress due to previous errors.
>>>> Finish compiling (exit: 1)
The wording is a bit different, but it exists on 12.0.0-alpha.11.
Annotating the type fixes the compiler warning, but optimizes the await away:
Doing a dynamic import will fail if the module to be imported as a module alias:
Here is a repository demonstrating the bug: https://github.com/CarlOlson/await-module-test
I tried to follow the example here: https://rescript-lang.org/blog/first-class-dynamic-import-support
Here is the output of the build:
The wording is a bit different, but it exists on
12.0.0-alpha.11
.Annotating the type fixes the compiler warning, but optimizes the await away:
The text was updated successfully, but these errors were encountered: