node_shims icon indicating copy to clipboard operation
node_shims copied to clipboard

TypeError: dntShim.Deno.seekSync is not a function

Open alexgleason opened this issue 2 years ago • 3 comments

When trying to transpile with shims, I get the following error:

FAILURES

blocks events that post the same content too quickly
  TypeError: dntShim.Deno.seekSync is not a function
      at js_read (file:///home/alex/Projects/strfry-policies/npm/esm/deps/deno.land/x/[email protected]/build/vfs.js:42:26)
      at wasm://wasm/0027cea2:wasm-function[84]:0x16fc
      at wasm://wasm/0027cea2:wasm-function[379]:0x236f6
      at wasm://wasm/0027cea2:wasm-function[373]:0x22415
      at wasm://wasm/0027cea2:wasm-function[385]:0x23c12
      at wasm://wasm/0027cea2:wasm-function[20]:0xf0f
      at wasm://wasm/0027cea2:wasm-function[1407]:0x9311b
      at file:///home/alex/Projects/strfry-policies/npm/esm/deps/deno.land/x/[email protected]/src/db.js:86:135
      at setStr (file:///home/alex/Projects/strfry-policies/npm/esm/deps/deno.land/x/[email protected]/src/wasm.js:13:24)
      at new DB (file:///home/alex/Projects/strfry-policies/npm/esm/deps/deno.land/x/[email protected]/src/db.js:86:24)error: Uncaught (in promise) Error: npm run test failed with exit code 1
        throw new Error(
              ^
    at runCommand (https://deno.land/x/[email protected]/lib/utils.ts:57:15)
    at async build (https://deno.land/x/[email protected]/mod.ts:386:5)
    at async file:///home/alex/Projects/strfry-policies/scripts/npm.ts:5:1

alexgleason avatar Apr 17 '23 00:04 alexgleason

I looked into this briefly and it seems that Node doesn't have a way to seek from the current position or end of the file. It seems some people do it by adding native bindings (ex. https://github.com/baudehlo/node-fs-ext/blob/3125353321c30bd35fc38e40ce76ffe3872e215b/fs-ext.js#L113).

I tried to at least have seek from the start of the file, but it didn't seem to work: https://github.com/dsherret/node_deno_shims/tree/seek

dsherret avatar May 09 '23 19:05 dsherret