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
I am trying to build CanvasKit using ES 6 modules as a result of the discussion in #12952
However, when I try to run my test code in node.js, I see the error
ReferenceError: __dirname is not defined
Which comes from the generated JS code around here:
if (ENVIRONMENT_IS_NODE) {
if (ENVIRONMENT_IS_WORKER) {
scriptDirectory = require('path').dirname(scriptDirectory) + '/';
} else {
scriptDirectory = __dirname + '/';
}
I talked with @RReverser and from that conversation:
If updating to 2.0.10 still doesn't work, then it's Emscripten bug that needs to be fixed (it probably assumes that Node.js never runs ES6 modules, which it does now and needs a feature detection to choose between __dirname and import.meta.url)
(I made sure I was using 2.0.10 and the issue still persists).
The text was updated successfully, but these errors were encountered:
I am trying to build CanvasKit using ES 6 modules as a result of the discussion in #12952
However, when I try to run my test code in node.js, I see the error
Which comes from the generated JS code around here:
I talked with @RReverser and from that conversation:
(I made sure I was using 2.0.10 and the issue still persists).
The text was updated successfully, but these errors were encountered: