execjs icon indicating copy to clipboard operation
execjs copied to clipboard

require is not a function

Open dylan-chong opened this issue 5 years ago • 1 comments

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 avatar Jan 29 '20 22:01 dylan-chong

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

dylan-chong avatar Jan 30 '20 21:01 dylan-chong