denoland / deno_doc

Documentation generator for Deno
MIT License
262 stars 55 forks source link

bug: `doc()` breaks on file with inter-package import #595

Closed iuioiua closed 5 months ago

iuioiua commented 5 months ago

Issue

In deno_std, doc("../uuid/v3.ts") fails with the following error:

error: Uncaught (in promise) Error: Failed resolving '@std/bytes/concat' from 'file:///Users/asher/GitHub/deno_std/uuid/v3.ts'.
      const ret = new Error(getStringFromWasm0(arg0, arg1));
                  ^
    at __wbg_new_28c511d9baebfa89 (https://jsr.io/@deno/doc/0.137.0/deno_doc_wasm.generated.js:413:19)
    at <anonymous> (file:///Users/asher/Library/Application%20Support/deno-wasmbuild/5c20b0581dff8285e401f6db3eac71dc267669a3d8f93dc26797c7b359ce9fdb.wasm:1:88709)
    at <anonymous> (file:///Users/asher/Library/Application%20Support/deno-wasmbuild/5c20b0581dff8285e401f6db3eac71dc267669a3d8f93dc26797c7b359ce9fdb.wasm:1:2428635)
    at <anonymous> (file:///Users/asher/Library/Application%20Support/deno-wasmbuild/5c20b0581dff8285e401f6db3eac71dc267669a3d8f93dc26797c7b359ce9fdb.wasm:1:2872842)
    at __wbg_adapter_48 (https://jsr.io/@deno/doc/0.137.0/deno_doc_wasm.generated.js:246:8)
    at real (https://jsr.io/@deno/doc/0.137.0/deno_doc_wasm.generated.js:231:14)
    at ext:core/01_core.js:302:9
    at eventLoopTick (ext:core/01_core.js:168:7)

Steps to reproduce

  1. Clone and cd into deno_std.
  2. Add ../uuid/v3.ts to the Standard Library's Super Linter.
  3. Run deno task lint:docs.

Setup

deno 1.43.6+2024c97 (canary, aarch64-apple-darwin)
v8 12.6.228.3
typescript 5.4.5

@deno/doc version: 0.137.0

Notes

  1. The Standard Library codebase is one with multiple workspaces (packages).
  2. Internal package imports are defined in the codebase's root deno.json file.
  3. This issue doesn't occur in other files which lack an inter-package import.
  4. The code in question executes fine.
crowlKats commented 5 months ago

Closing as discussed directly, this is intended behaviour as deno_doc does not handle jsr imports.