You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somehow an array was passed over instead of the content (?) of the array.
This is a brand new project I just generated using the Docker image, no further modifications were applied.
Failure Logs
[forest] 🌳🌳🌳 Unexpected error: attribute.split is not a function
TypeError: attribute.split is not a function
at /usr/src/app/node_modules/jsonapi-serializer/lib/serializer-utils.js:294:42
at /usr/src/app/node_modules/lodash/_createBaseFor.js:17:11
at baseForOwn (/usr/src/app/node_modules/lodash/_baseForOwn.js:13:20)
at /usr/src/app/node_modules/lodash/_createBaseEach.js:17:14
at forEach (/usr/src/app/node_modules/lodash/forEach.js:38:10)
at module.exports.perform (/usr/src/app/node_modules/jsonapi-serializer/lib/serializer-utils.js:292:5)
at /usr/src/app/node_modules/jsonapi-serializer/lib/serializer.js:27:43
at Array.forEach (<anonymous>)
at collection (/usr/src/app/node_modules/jsonapi-serializer/lib/serializer.js:24:15)
at module.exports.serialize (/usr/src/app/node_modules/jsonapi-serializer/lib/serializer.js:55:14)
at new module.exports (/usr/src/app/node_modules/jsonapi-serializer/lib/serializer.js:65:17)
at /usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/dist/serializers/resource.js:201:14
at tryCatcher (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:673:18)
at Promise._resolveCallback (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:466:57)
at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:559:17)
at Promise._settlePromise (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:673:18)
at Promise._resolveCallback (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:466:57)
at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:559:17)
at Promise._settlePromise (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:673:18)
at MappingPromiseArray.PromiseArray._resolve (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise_array.js:127:19)
at MappingPromiseArray._promiseFulfilled (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/map.js:108:18)
at Promise._settlePromise (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:609:26)
at Promise._settlePromise0 (/usr/src/app/node_modules/forest-express-sequelize/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:649:10)
Context
Project was created using the Docker method.
Package Version: "^6.0.0",
Express Version: "~4.16.3",
Sequelize Version: "~5.15.1",
Database Dialect: Postgres
Database Version: 12
The text was updated successfully, but these errors were encountered:
The serializationOptions object contains an attributes key that should hold an array. However when getAttributesFor(serializationOptions, schema.fields) is called, if the database schema has a table called attribute it'll be serialized into attributes thus overriding the initial attributes field in the serializationOptions object.
Solution
It would be the best to group all database schema related attributes into a separate field in serializationOptions instead of injecting them right at the root.
Expected behavior
Should not throw error while creating a new row from the Forest UI.
Actual behavior
Can not create new row in table because of
TypeError: attribute.split is not a function
in https://github.com/SeyZ/jsonapi-serializer/blob/b0315e95e6156395590094c3c48fce6e3c75bf95/lib/serializer-utils.js#L293, see stack trace below.If I add a
console.log(attribute)
to see what's being passed I get:Somehow an array was passed over instead of the content (?) of the array.
This is a brand new project I just generated using the Docker image, no further modifications were applied.
Failure Logs
Context
Project was created using the Docker method.
The text was updated successfully, but these errors were encountered: