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

issues with the js module #525

Open
sigmaSd opened this issue Mar 11, 2024 · 1 comment
Open

issues with the js module #525

sigmaSd opened this issue Mar 11, 2024 · 1 comment

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Mar 11, 2024

import { doc } from "https://deno.land/x/deno_doc@0.117.0/mod.ts";
import { pathToFileURL } from "node:url"; // this line trigger the error

console.log(await doc(import.meta.url));

error

error: Uncaught (in promise) Error: Failed resolving 'node:url' from 'file:///home/mrcool/dev/deno/lab/a.ts'.
      const ret = new Error(getStringFromWasm0(arg0, arg1));
                  ^
    at __wbg_new_a64e3f2afc2cf2f8 (https://deno.land/x/deno_doc@0.117.0/deno_doc_wasm.generated.js:404:19)
    at <anonymous> (file:///home/mrcool/.local/share/deno-wasmbuild/e7a23ed6bef70972bd288456786eaea32d8aa736d7ad6e9e71df1e02640116c1.wasm:1:89851)
    at <anonymous> (file:///home/mrcool/.local/share/deno-wasmbuild/e7a23ed6bef70972bd288456786eaea32d8aa736d7ad6e9e71df1e02640116c1.wasm:1:2384079)
    at <anonymous> (file:///home/mrcool/.local/share/deno-wasmbuild/e7a23ed6bef70972bd288456786eaea32d8aa736d7ad6e9e71df1e02640116c1.wasm:1:2826498)
    at __wbg_adapter_48 (https://deno.land/x/deno_doc@0.117.0/deno_doc_wasm.generated.js:240:8)
    at real (https://deno.land/x/deno_doc@0.117.0/deno_doc_wasm.generated.js:225:14)
    at ext:core/01_core.js:303:9
    at eventLoopTick (ext:core/01_core.js:169:7)

note that deno doc works correctly

Another note doc takes specifier argument as string but I think it should be URL since that's what it accepts at runtime

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Mar 11, 2024

Also its slow, any way to improve the performance in the future ? it takes atleast one second to run

import { doc } from "https://deno.land/x/deno_doc@0.117.0/mod.ts";

console.log(performance.now().toFixed(2), "ms");
await doc(import.meta.url);
console.log(performance.now().toFixed(2), "ms");
66.81 ms
1141.09 ms

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

No branches or pull requests

1 participant