devinus / execjs

Run JavaScript code from Elixir
https://github.com/devinus/execjs
Creative Commons Zero v1.0 Universal
150 stars 22 forks source link

require is not a function #15

Open dylan-chong opened 4 years ago

dylan-chong commented 4 years ago
iex(2)> Execjs.eval("const aaa = require('aaa')")
** (Execjs.RuntimeError) TypeError: require is not a function
    lib/execjs.ex:90: Execjs.extract_result/1
    lib/execjs.ex:55: Execjs.exec/1
dylan-chong commented 4 years ago

I see that require was intentionally set to undefined as a function argument. Why? I want to be able to require libraries/ JavaScript files I've created