herbsjs / herbs-cli

Herbs CLI
https://herbsjs.org/
MIT License
30 stars 30 forks source link

herbs update - Entities with fields with another entity as type #64

Closed dalssoft closed 2 years ago

dalssoft commented 3 years ago

ex:

    entity('ToDoList', {
        id: field(Number),
        items: field([Item]),

error:

TypeError: Type is not a constructor
    at type2Str (C:\Users\David\AppData\Roaming\npm\node_modules\@herbsjs\herbs-cli\src\generators\new\infra\database\migrations\migrations.js:5:17)
    at C:\Users\David\AppData\Roaming\npm\node_modules\@herbsjs\herbs-cli\src\generators\new\infra\database\migrations\migrations.js:28:33  
    at Array.forEach (<anonymous>)
    at Object.migrations (C:\Users\David\AppData\Roaming\npm\node_modules\@herbsjs\herbs-cli\src\generators\new\infra\database\migrations\migrations.js:25:29)
    at Command.run (C:\Users\David\AppData\Roaming\npm\node_modules\@herbsjs\herbs-cli\src\commands\update.js:9:75)
italojs commented 3 years ago

@dalssoft can you prove more detail of how can I reproduce it?

dalssoft commented 3 years ago
const A = entity('A', { id: field(Number), })

const B = entity('B', {
        id: field(Number),
        field1: field([A]),
})

> herbs update

PedroHaupenthal commented 2 years ago

@jhomarolo could you add the wip tag please?

vma-vortx commented 2 years ago

@PedroHaupenthal have you worked on this issue? The wip is still valid?

dalssoft commented 2 years ago

After so many updates on herbscli, is it still a valid issue? Can someone check?

dalssoft commented 2 years ago

I can confirm that the error is still happening

jhomarolo commented 2 years ago

@PedroHaupenthal have you worked on this issue?

herbsjs-robot commented 2 years ago

:tada: This issue has been resolved in version 2.7.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

dalssoft commented 2 years ago

Related / evolution: https://github.com/herbsjs/herbs-cli/issues/145

endersoncosta commented 2 years ago

I take this issue