thrift-typescript icon indicating copy to clipboard operation
thrift-typescript copied to clipboard

Using make with custom namespaces throws error

Open ricsmania opened this issue 5 years ago • 0 comments

When I try to run the following code it throws an error:

import { make } from '@creditkarma/thrift-typescript';

make(`namespace java com.my.service
namespace js thrift

struct Response {
  1: string id  
}

service TestService {
  Response getState(1: Response request)
}`);

The error is:

TypeError: Cannot read property 'exports' of undefined at Object.make (/Users/ricardo/projects/jimdo/thrift-cli/node_modules/@creditkarma/thrift-typescript/src/main/index.ts:76:18)

This seems to be because the make method looks for the __ROOT_NAMESPACE__ namespace, but that doesn't exist when I use custom namespaces.

This started after I upgraded to version 3.7.6. I was using version 3.5.0 before and it worked.

ricsmania avatar Oct 29 '19 16:10 ricsmania