- Start up the server by running
node app.js
- Send a
POST
requests to/test/test
- Observe the failure:
TypeError: Cannot convert undefined or null to object
- This is referencing to
sails.models
inres.send(Object.keys(sails.models))
- Go to
Test1Service.js
inapi/services
- Comment out line 4
- Start up the server by running
node app.js
- Send a
POST
requests to/test/test
- Observe the successful response:
["test"]
We believe that a service that require
s in another service (which itself require
s in sails
) has changed in behavior with Node version 8.3.0
. If you use NVM, run the same project in 8.2.0
and observe that even with Test1Service.js:4
uncommented, it still works (compared to the failing case with Node 8.3.0
).