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

Command failed: npx cds2types #30

Open
gabriel-inf opened this issue Jun 1, 2022 · 1 comment
Open

Command failed: npx cds2types #30

gabriel-inf opened this issue Jun 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@gabriel-inf
Copy link

Hi!

I'm trying to compose a view for a select that should aggregate values using group by and sum. I'm able to create the view executing cds deploy but when running npx cds2types --cds file.cds --output output.ts -f to create the types I get the following error:

view ViewA as
  select from TableA as ta
  inner join Tableb as tb
    on tb.id = ta.tableBId
  {
    ta.field1 as field1,
+  sum(tb.field2) as field2
  }
  where
    <conditions>
  group by
    ta.field1;

if I don't use sum, it works well,

Error: Command failed: npx cds2types --cds file.cds --output output.ts -f
    at checkExecSyncError (child_process.js:790:11)
    at execSync (child_process.js:863:15)
    at Object.<anonymous> (~/scripts/convert-entities-to-ts.js:21:3)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  status: 255,
  signal: null,
  output: [
    null,
    Buffer(93) [Uint8Array] [
       85, 110,  97,  98, 108, 101,  32, 116, 111,  32, 119, 114,
      105, 116, 101,  32, 116, 121, 112, 101, 115,  46,  32,  80,
      108, 101,  97, 115, 101,  32, 117, 115, 101,  32, 116, 104,
      101,  32, 100, 101,  98, 117, 103,  32, 102, 108,  97, 103,
       32,  40,  45, 100,  44,  32,  45,  45, 100, 101,  98, 117,
      103,  41,  32, 102, 111, 114,  32,  97,  32, 100, 101, 116,
       97, 105, 108, 101, 100,  32, 101, 114, 114, 111, 114,  32,
      109, 101, 115, 115,  97, 103, 101,  46,  10
    ],
    Buffer(0) [Uint8Array] []
  ],
  pid: 62610,
  stdout: Buffer(93) [Uint8Array] [
     85, 110,  97,  98, 108, 101,  32, 116, 111,  32, 119, 114,
    105, 116, 101,  32, 116, 121, 112, 101, 115,  46,  32,  80,
    108, 101,  97, 115, 101,  32, 117, 115, 101,  32, 116, 104,
    101,  32, 100, 101,  98, 117, 103,  32, 102, 108,  97, 103,
     32,  40,  45, 100,  44,  32,  45,  45, 100, 101,  98, 117,
    103,  41,  32, 102, 111, 114,  32,  97,  32, 100, 101, 116,
     97, 105, 108, 101, 100,  32, 101, 114, 114, 111, 114,  32,
    109, 101, 115, 115,  97, 103, 101,  46,  10
  ],
  stderr: Buffer(0) [Uint8Array] []
}

Does anyone ever faced this issue or has any clue on how to fix it? Thank you!

@thisisevanfox thisisevanfox added the bug Something isn't working label Nov 9, 2022
@thisisevanfox
Copy link
Collaborator

Hi @gabriel-inf,

We'll look into this one. Thanks for reporting.

Kind regards
Johannes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants