8000 [Bug] "DatasetPublic" Type Not Exported from Main Module · Issue #2034 · comet-ml/opik · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug] "DatasetPublic" Type Not Exported from Main Module #2034

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

Closed
serkon opened this issue May 5, 2025 · 3 comments
Closed

[Bug] "DatasetPublic" Type Not Exported from Main Module #2034

serkon opened this issue May 5, 2025 · 3 comments

Comments

@serkon
Copy link
serkon commented May 5, 2025

Hi team,

While integrating the opik package to Nuxt 3 project, I encountered a TypeScript issue due to the DatasetPublic type not being exported from the main module entry ("opik"). Although DatasetPublic is defined and exported in dist/Client-DIPn3Z2T.d.ts, it’s not accessible via:

import type { DatasetPublic } from 'opik';
// ❌ Module '"opik"' has no exported member 'DatasetPublic'.ts(2305)

This causes problems when using strongly typed refs:

const datasets = ref<DatasetPublic[]>([]); // Type error unless DatasetPublic is manually defined or cast

Expected Behavior
I would expect DatasetPublic (and similar public-facing types) to be exported from the package root, so they can be imported directly:

import type { DatasetPublic } from 'opik';

Suggested Fix
Please consider explicitly exporting DatasetPublic and any other relevant types from the main module entry point.

Thank you!

@aadereiko
Copy link
Collaborator

Hey @serkon , thank you for reporting this issue. We'll take a look at it soon and get back to you :)

@juanferrub juanferrub changed the title "DatasetPublic" Type Not Exported from Main Module [Bug] "DatasetPublic" Type Not Exported from Main Module May 6, 2025
@aadereiko
Copy link
Collaborator

@serkon we've merged the fix into main #2038. In the near future, we will release a new version of Typesrcript SDK and you will be able to re-use it :)

@serkon
Copy link
Author
serkon commented May 6, 2025

Thanks for the update @aadereiko , but I noticed that you've only exported the DatasetPublic interface.

In general, TypeScript developers often need access to all interfaces defined in your .d.ts file — not just a single one. This is especially useful when working in projects like Nuxt 3, where global type declarations can simplify usage.

To make it work on my end, I copied the dist/Client-DIPn3Z2T.d.ts file into my local types/ folder and wrapped your type definitions like this:

declare global { // added this line
  interface OpikConfig {
    apiKey: string;
    apiUrl?: string;
    projectName: string;
    workspaceName: string;
  }

  // ... other interface declarations

  declare class OpikClient {
    api: OpikApiClient;
    config: OpikConfig;
    spanBatchQueue: SpanBatchQueue;
    traceBatchQueue: TraceBatchQueue;
    spanFeedbackScoresBatchQueue: SpanFeedbackScoresBatchQueue;
    traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
    private lastProjectNameLogged;
    constructor(explicitConfig?: Partial<OpikConfig>);
    private displayTraceLog;
    trace: (traceData: TraceData) => Trace;
    flush: () => Promise<void>;
  }

  // ... end of the file
} // added this line

export {}; // also added this line for global export

With this approach, I can use all the types across my project without importing them manually.

It would be great if you could consider exporting all interfaces from your SDK directly, so developers can benefit from better type support out of the box.

Thanks!

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

2 participants
0