momenttech / lysis

CLI and engine for code generation from JSON LD APIs
MIT License
18 stars 3 forks source link

Cannot read property 'split' of null #3

Closed vichanse closed 6 years ago

vichanse commented 6 years ago

Hi David,

I'm having this error when i run lysis on one of my projects. image

Is there any way that i can have access to lysis logs? Have you any idea of where it can come from?

Thank you for your answer

partageit commented 6 years ago

Hi Vicky,

I have an idea :)

A property in you API Platform is not linked to the ORM and doesn't have @type annotation.

class Book {
  // [...]
  /**
   * this one is typed via ORM
   * @ORM\Column(type="string", length=255, nullable=true)
   */
  protected $field1;

  /**
   * this one is typed via docblock annotation
   * @var string
   */
  protected $field2;

  /**
   * this one is not typed and leads to a 'Cannot read property 'split' of null
   */
  protected $field3;
  // [...]
}

In the next lysis version, I will catch this error, with a proper error message.

vichanse commented 6 years ago

Hi David,

Gr8. Problem solved 👍