Skip to content

TypeError: Cannot read property 'push' of undefined #187

@clupo

Description

@clupo

At first I got this error when I added a simple dependecies property to a model. Then I also found it when I've run a few of the examples in test/fixtures.

I'm using version 1.4.0

TypeError: Cannot read property 'push' of undefined
at Document._callee$ (C:\Users\clupo\AppData\Roaming\npm\node_modules\fakeit\dist\documents.js:384:59)
at tryCatch (C:\Users\clupo\AppData\Roaming\npm\node_modules\fakeit\node_modules\regenerator-runtime\runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\clupo\AppData\Roaming\npm\node_modules\fakeit\node_modules\regenerator-runtime\runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\clupo\AppData\Roaming\npm\node_modules\fakeit\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\clupo\AppData\Roaming\npm\node_modules\fakeit\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\clupo\AppData\Roaming\npm\node_modules\fakeit\node_modules\babel-runtime\helpers\asyncToGenerator.js:28:13

What's weird is after a npm install I run fakeit directory temp "C:\Users\clupo\Downloads\fakeit-master\fakeit-master\test\fixtures\models\ecommerce\models" it runs fine and creates all the data. But then if I make the output directory empty again and rerun fakeit then it fails for all other subsequent runs with the error above

Here's a video demo of the problem with fixtures\models\ecommerce - photos.app.goo.gl

I think it's related to the dependencies property because when I made a model such as modelA that had no dependencies fakeit created them all fine. However when I made a modelB that depended on modelA via the dependencies property then I reproduced the error above when I tried to generate data for modelB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions