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

'Duration' import from '@bufbuild/protobuf' results in a none working sdk/cli #363

Closed
enimatek-nl opened this issue Dec 26, 2024 · 2 comments
Assignees

Comments

@enimatek-nl
Copy link

import { Duration } from '@bufbuild/protobuf';

When starting an Agent(js) Node, Deno and Bun fail on this import line.

1 | (function (entry, fetcher)
    ^
SyntaxError: Export named 'Duration' not found in module '[...]/node_modules/@bufbuild/protobuf/dist/esm/index.js'.

Removing it solves the issue.

The import seems to be a mistake by the last commit, since it has no purpose afaik.

@valdrox
Copy link

valdrox commented Dec 29, 2024

There's an open PR for this I believe. The following fixed it for me in the meantime:

// .pnpmfile.cjs

module.exports = {
  hooks: {
    readPackage(pkg) {
      if (pkg.name === 'livekit-server-sdk') {
        // the problem is outlined here https://github.com/livekit/node-sdks/pull/351
        // Check if the devDependencies contains "@bufbuild/protobuf"
        if (pkg.dependencies && !pkg.dependencies['@bufbuild/protobuf']) {
          // Add it to dependencies
          pkg.dependencies['@bufbuild/protobuf'] = '^1.7.2';
        }
      }
      return pkg;
    },
  },
};

@lukasIO
Copy link
Contributor

lukasIO commented Jan 7, 2025

thanks for the report, this got indeed fixed in #351

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

3 participants