birkir / prime

✨Open Source GraphQL CMS
https://docs.primecms.app
MIT License
1.72k stars 112 forks source link

TypeError: Cannot read property 'removeSchema' of null #165

Open shivekkhurana opened 5 years ago

shivekkhurana commented 5 years ago

Hi @birkir

Thanks for building this headless cms. It is very simple and intuitive.

While deleting a schema from the UI (hosted on free Heroku), I get the following error, after pressing ok on the confirmation dialogue.

[GraphQL error]: Message: timestamp out of range: "1556171380226", {message: "timestamp out of range: "1556171380226"", locations: Array(1), path: Array(1), extensions: {…}}extensions: code: "INTERNAL_SERVER_ERROR"exception: code: "22008"file: "timestamp.c"length: 99line: "176"message: "timestamp out of range: "1556171380226""name: "QueryFailedError"parameters: (2) ["4b824c90-8e1a-4d9c-832c-c9e27b62bfbf", 1556171380226]query: "UPDATE "document" SET "deletedAt" = $2, "updatedAt" = CURRENT_TIMESTAMP WHERE "schemaId" = $1"routine: "timestamp_in"severity: "ERROR"__proto__: Object__proto__: Objectlocations: Array(1)0: {line: 2, column: 3}column: 3line: 2__proto__: Objectlength: 1__proto__: Array(0)message: "timestamp out of range: "1556171380226""path: Array(1)0: "removeSchema"length: 1__proto__: Array(0)__proto__: Object
ContentType.ts:114 Uncaught (in promise) TypeError: Cannot read property 'removeSchema' of null
    at ContentType.ts:114
    at S (runtime.js:63)
    at Generator._invoke (runtime.js:282)
    at Generator.e.(/schemas/anonymous function) [as next] (https://sitecms.herokuapp.com/static/js/1.e6e35909.chunk.js:1:2107412)
    at mobx-state-tree.module.js:3130
    at X (mobx.module.js:646)
    at n (mobx.module.js:635)
    at mobx-state-tree.module.js:2228
    at ce (mobx-state-tree.module.js:2112)
    at c (mobx-state-tree.module.js:3090)
(anonymous) @ ContentType.ts:114
S @ runtime.js:63
(anonymous) @ runtime.js:282
e.(anonymous function) @ runtime.js:116
(anonymous) @ mobx-state-tree.module.js:3130
X @ mobx.module.js:646
n @ mobx.module.js:635
(anonymous) @ mobx-state-tree.module.js:2228
ce @ mobx-state-tree.module.js:2112
c @ mobx-state-tree.module.js:3090
p @ mobx-state-tree.module.js:3129
postMessage (async)
r @ setImmediate.js:136
s.setImmediate @ setImmediate.js:34
p @ mobx-state-tree.module.js:3134
Promise.then (async)
h @ mobx-state-tree.module.js:3180
p @ mobx-state-tree.module.js:3142
f @ mobx-state-tree.module.js:3108
X @ mobx.module.js:646
n @ mobx.module.js:635
(anonymous) @ mobx-state-tree.module.js:2228
ce @ mobx-state-tree.module.js:2112
(anonymous) @ mobx-state-tree.module.js:3112
r @ mobx-state-tree.module.js:3103
X @ mobx.module.js:646
n @ mobx.module.js:635
(anonymous) @ mobx-state-tree.module.js:2228
ce @ mobx-state-tree.module.js:2112
r @ mobx-state-tree.module.js:2137
onConfirm @ SchemaList.tsx:95
onConfirm @ index.js:142
n.handleClick @ button.js:200
...

Is this related to the application or the infra?

birkir commented 5 years ago

This is a bug. Thank you for reporting! 👍