Skip to content

Using protobuf not possible #504

@samuil4

Description

@samuil4

Describe the bug
When trying to use @bufbuild/protobuf package the server can't compile the files where there are imported functions from this module.

To Reproduce
Steps to reproduce the behavior

  1. Install @bufbuild/protobuf
  2. Include create, toBinary or other function from the package in a router file
  3. compile to get error
‧ Error: [files:load:E:/projects/my-project/mocks/routes/my-test-route.ts] Error loading file E:/projects/my-project/mocks/routes/my-test-route.ts: Unexpected token '{'
         SyntaxError: Unexpected token '{'
             at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
             at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:353:18)...

Expected behavior
Able to use the package to return data as proto binary object

Logs
If applicable, add logs to help explain your problem.

** Operating system, Node.js an npm versions, or browser version (please complete the following information):**

  • OS: windows
  • Node.js: v22.14.0
  • npm: 11.2.0
  • Browser: cmd, powershell, bash

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions