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

fix: add typings to package output #1300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dnikitop
Copy link

Changelog

Docs

Description

Getting these errors in when importing

node_modules/@mcap/support/dist/esm/src/protobufDescriptors.d.ts:1:22 - error TS6053: File '/home/dimitri/src/rosbags2js/node_modules/@mcap/support/typings/protobufjs.d.ts' not found.

1 /// <reference path="../../../typings/protobufjs.d.ts" />
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@mcap/support/dist/esm/src/protobufDescriptors.d.ts:3:61 - error TS2339: Property 'toDescriptor' does not exist on type 'Root'.

3 export type ProtobufDescriptor = ReturnType<protobufjs.Root["toDescriptor"]>;                                       

PR adds typings/protobufjs.d.ts to package

BeforeAfter

@jtbandes
Copy link
Member

jtbandes commented Jan 6, 2025

What were you importing that caused this error? I've never seen this before.

@dnikitop
Copy link
Author

dnikitop commented Jan 6, 2025

What were you importing that caused this error? I've never seen this before.

Create a new package that imports this.
Importing

import { parse as parseMessageDefinition } from "@foxglove/rosmsg";
import {
  LazyMessageReader as ROS1LazyMessageReader,
  Time,
} from "@foxglove/rosmsg-serialization";
import { MessageReader as ROS2MessageReader } from "@foxglove/rosmsg2-serialization";
import { McapStreamReader, McapTypes } from "@mcap/core";
import { loadDecompressHandlers } from "@mcap/support";
import { createReadStream } from "fs";
import { isEqual } from "lodash";
import { performance } from "perf_hooks";
import protobufjs from "protobufjs";
import { FileDescriptorSet } from "protobufjs/ext/descriptor";

Using this tsconfig

{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es2020",
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "dist",
    "lib": ["es2020"]
  }
}

@dnikitop
Copy link
Author

dnikitop commented Jan 8, 2025

@jtbandes any updates on this?

I can create sample repo trying to import the mcap packages to show the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants