jsr icon indicating copy to clipboard operation
jsr copied to clipboard

Fails to generate documentation and publish when dep is `@types/*`

Open o-az opened this issue 1 year ago • 1 comments

I'm trying to publish this: https://github.com/rehype-pretty/rehype-pretty-code/tree/master/packages/core

I run: pnpm dlx jsr@latest publish --allow-dirty and get the following:

error: Failed to publish @rehype-pretty/[email protected]

Caused by:
    Failed to publish @rehype-pretty/core at 0.13.2: failed to generate documentation: Failed resolving './hast' from 'file:///src/index.ts'.

    Stack backtrace:
       0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
       1: registry_api::docs::generate_docs
       2: registry_api::analysis::analyze_package_inner::{{closure}}::{{closure}}
       3: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
       4: <core::pin::Pin<P> as core::future::future::Future>::poll
       5: tokio::runtime::scheduler::current_thread::Context::enter
       6: tokio::runtime::context::scoped::Scoped<T>::set
       7: tokio::runtime::context::set_scheduler
       8: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
       9: tokio::runtime::context::runtime::enter_runtime
      10: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
      11: tokio::runtime::task::core::Core<T,S>::poll
      12: tokio::runtime::task::harness::Harness<T,S>::poll
      13: tokio::runtime::blocking::pool::Inner::run
      14: std::sys_common::backtrace::__rust_begin_short_backtrace
      15: core::ops::function::FnOnce::call_once{{vtable.shim}}
      16: std::sys::pal::unix::thread::Thread::new::thread_start
      17: <unknown>
      18: <unknown>
Child process exited with: 1

One of the package dependencies is @types/hast. The relevant import is here: https://github.com/rehype-pretty/rehype-pretty-code/blob/master/packages/core/src/index.ts#L1

Is there something I need to do to resolve this?

o-az avatar May 14 '24 07:05 o-az

Just move @types/* to devDependencies.

typed-sigterm avatar Nov 25 '24 15:11 typed-sigterm