Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node comapt: Deno.openSync shim seems to fail #20910

Closed
sigmaSd opened this issue Oct 14, 2023 · 0 comments · Fixed by #20953
Closed

node comapt: Deno.openSync shim seems to fail #20910

sigmaSd opened this issue Oct 14, 2023 · 0 comments · Fixed by #20953

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Oct 14, 2023

I have a package that uses dnt to build to npm, dnt locally works and pass all the tests

But If import the published package it fails with

error: Uncaught (in promise) Error: OpenOptions requires at least one option to be true
    at checkOpenOptions (ext:deno_fs/30_fs.js:681:11)
    at Object.openSync (ext:deno_fs/30_fs.js:560:16)
    at openSync (ext:deno_node/_fs/_fs_open.ts:98:15)
    at Object.openSync (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/@deno/shim-deno/0.16.1/dist/deno/stable/functions/openSync.js:25:38)
    at Module.getFromPath (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/deno-infer/1.0.6/esm/mod.js:56:31)
    at file:///home/mrcool/dev/deno/denoseal/main.ts:16:21

I added some debug statements, and openSync in deno shim does pass O_READONLY (which seems to be encoded as 0) to deno_node

To reproduce:

import * as infer from "npm:deno-infer@1.0.7";
const type = infer.getFromPath("/usr/bin/ls");

The code for that version is here https://github.com/sigmaSd/deno-infer/tree/80c3c8b4861386701a4b714f8d59ff224577a6a6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant