I have some nim code with embedded js like this:
const myJsCode = """
import fs from 'fs'
// ...
"""
{.emit:myJsCode.}
import tables
# ...
The imports work fine in node.js as long as the code is compiled to a file with extension .mjs. However, the following
const myJsCode = """
import fs from 'fs'
// ...
"""
{.emit:myJsCode.}
import tables, times
# ...
produces a runtime error:
utcInstance_10980231 = [null];
^
ReferenceError: utcInstance_10980231 is not defined
I'm guessing this is because there is a special js version of times? Does anyone have a workaround for this?