You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checking for slow types in the public API...
Check file:///Users/andrew/Code/andykais/ts-rpc/client.ts
Check file:///Users/andrew/Code/andykais/ts-rpc/adapters/oak.ts
error: Failed ensuring public API type output is valid.
TS2304 [ERROR]: Cannot find name 'adapter_base'.
class ServerAdapter extends adapter_base.ServerAdapter {
~~~~~~~~~~~~
at file:///Users/andrew/Code/andykais/ts-rpc/adapters/oak.ts:36:29
You may have discovered a bug in Deno. Please open an issue at: https://github.com/denoland/deno/issues/
source code
import * as oak from 'jsr:@oak/oak'
import * as contracts from '../src/contracts.ts'
import * as adapter_base from './mod.ts'
import {ClientRealtimeEmitter, ApiController, ClientRequest} from '../server.ts'
type OakRouterContext = oak.RouterContext<string, Record<string | number, string>, Record<string, any>>
type OakRouterFunction = (ctx: OakRouterContext) => Promise
class ServerSentEventsAdapter extends adapter_base.ServerSentEventsAdapter {
#status_resolved: PromiseWithResolvers
#target: oak.ServerSentEventTarget
get status() {
return this.#status_resolved.promise
}
send(contract: contracts.EventContract) {
const success = this.#target.dispatchMessage(JSON.stringify(contract))
if (!success) {
throw new Error(Failed to dispatch message over server sent events adapter ${this.#target})
}
}
}
class ServerAdapter extends adapter_base.ServerAdapter {
async handle_server_sent_events_request(ctx: OakRouterContext) {
// TODO error out if x-rpc-connection-id is already present?
const target = await ctx.sendEvents()
const sse_adapter = new ServerSentEventsAdapter(target)
export const adapt = ServerAdapter.adapt
export * from '../server.ts'
I can solve this issue by exporting adapter_base in this module. This is just a bit confusing for users to see this exported when using the library. Can someone confirm if this is an expected error?
👍 well thanks for the support. For now I can unblock myself with additional exports, Ill keep an eye on that pr though and close this issue out if my issue is fixed once that is released
Version: Deno 1.43.1
source code
I can solve this issue by exporting
adapter_base
in this module. This is just a bit confusing for users to see this exported when using the library. Can someone confirm if this is an expected error?additional information
the source code is here https://github.com/andykais/ts-rpc/blob/deno-to-node-experiment/adapters/oak.ts (and this is the repo at the point in time that this issue was created https://github.com/andykais/ts-rpc/tree/dcff52451eacc06328153c74926acfe2e072ac2c)
The text was updated successfully, but these errors were encountered: