rhai: Bug/Question on importing modules

Lets assume we have the following structure

  • index.rhai
  • lib
    • common.rhai

Where the files have the following content

index.rhai

import "lib/common";

print("index");

lib/common.rhai

print("common");

Now if I do the following the program just freezes

let ast = engine.compile("<path to index.rhai>").unwrap();
Module::eval_ast_as_new(Scope::new(), &ast, engine).unwrap();

Any idea why this could happen?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Most upvoted comments

Works for me 👍

Again, turns out to be a relatively simple fix.

Pull from the latest master to test out. Your last example should work now.