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
@paulfitz this is a great library and seems to work in NodeJS. I'm trying to use bin/daff.js in Deno TypeScript and JavaScript runtime but am getting the following error:
> deno run -A bin/daff.js
error: Uncaught TypeError: Cannot read property 'Coopy' of undefined
for (f in coopy.Coopy) {
^
at file:///home/snshah/workspaces/github.com/paulfitz/daff/bin/daff.js:10607:21
This is probably a problem in the Haxe JS generator but other Haxe generated JS files seem to run in Deno's JavaScript runtime. Any thoughts?
Thanks!
The text was updated successfully, but these errors were encountered:
I tried running deno run -A bin/daff.js and fixing up problems ad-hoc, just to assess how much was broken. There were a bunch of trivial problems - code for picking what global object (exports/windows/...) to put the library in was failing - hacking it to use self worked, I'd be interested to know how libraries should behave in deno. Then there were some syntax issues (missing "var" declarations) - easy. But then there were complaints about require is not defined (e.g. require('fs')) and I don't know what to replace that with. As a library, daff doesn't need requires, but as a console tool it does. I'd welcome any advice.
Excellent sleuthing @paulfitz thanks for checking into this. Deno has its own fs module and cannot use the Node fs module so that might be tricky to fix (since, I suppose, Haxe is generating the require fs?). For the 'require' replacement, that's easy -- Deno supports EcmaScript imports.
@paulfitz this is a great library and seems to work in NodeJS. I'm trying to use
bin/daff.js
in Deno TypeScript and JavaScript runtime but am getting the following error:This is probably a problem in the Haxe JS generator but other Haxe generated JS files seem to run in Deno's JavaScript runtime. Any thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: