Wappler Version : v5.4.3
Operating System : MacOs
Server Model: NodeJs
Database Type: mySQL (Maria DB)
Hosting Type: Local Server
Expected behavior
Paged database query return results.
Actual behavior
TypeError: Cannot read properties of undefined (reading 'toISOString')\n at formatRecord (../lib/core/app.js:362:75)\n at ../lib/core/app.js:390:45\n at Array.map (<anonymous>)\n at Object.options.postProcessResponse (../lib/core/app.js:390:31)\n at Client_MySQL.postProcessResponse (../node_modules/knex/lib/client.js:164:26)\n at ../node_modules/knex/lib/execution/runner.js:135:51\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Runner.ensureConnection (../node_modules/knex/lib/execution/runner.js:300:14)\n at async Runner.run (../node_modules/knex/lib/execution/runner.js:30:19)\n at async App.paged (../lib/modules/dbconnector.js:587:20)
How to reproduce
Create a database view
Setup a paged query server action using the view
Note: This query works fine on v5.3.2… I’ve gotten the error on every update following that.
Sorry I’m just getting back to you Patrick.
The view does have a datetime column in the output, but the column has no null values (I’ve just done a search).
I had actually set my default value for the column as ‘null’, but changed that when I looked up the error and found it was related to what you’ve mentioned.
Was there any resolution to this problem? I’m hitting against this right now. All I’m trying to do is send a simple password reset email that works out the length of time between the POST event and NOW time, I think this is what is triggering the error above.
It works fine on my local server (Windows11) but not on the production server (Windows Server 2016) Using Wappler 5.6.1
{status: "500", message: "Cannot read properties of undefined (reading 'toISOString')",…}
message
:
"Cannot read properties of undefined (reading 'toISOString')"
stack
:
"TypeError: Cannot read properties of undefined (reading 'toISOString')\n at formatRecord (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\core\\app.js:362:75)\n at C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\core\\app.js:390:45\n at Array.map (<anonymous>)\n at options.postProcessResponse (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\core\\app.js:390:31)\n at Client_MySQL.postProcessResponse (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\node_modules\\knex\\lib\\client.js:164:26)\n at C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\node_modules\\knex\\lib\\execution\\runner.js:135:51\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Runner.ensureConnection (C:\\Inetpub\\vhosts\\xxxxxxxxxxcom\\httpdocs\\node_modules\\knex\\lib\\execution\\runner.js:300:14)\n at async Runner.run (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\node_modules\\knex\\lib\\execution\\runner.js:30:19)\n at async App.exists (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\validator\\db.js:7:25)"
status
:
"500"
No, none that I know of.
I really don’t know exactly what triggered mine, but it started after a Wappler update.
That project is pretty much stuck on v5.3.2.
As far as I can see it was working before 5.6.1, I took out the timediff set value item from Server Actions and still get the same error being triggered. Strange, as it works on the local copy but not the remote. @patrick any ideas?
@patrick this is still throwing an error, as far as I can see I’m not using toISOString in this page yet this error is being thrown. I’m reluctant to spend much more time looking at it until we can confirm either way that this is or isn’t a bug.
I’ve removed all the set value and the timdiff condition. Ive also taken the hyphen out of the POST name-dingbat
This one has me stumped, its working great on the local server but not in remote. I get the feeling a file has been missed during publish, but re-publishing multiple times throws the same error
{status: "500", message: "Cannot read properties of undefined (reading 'toISOString')",…}
message
:
"Cannot read properties of undefined (reading 'toISOString')"
stack
:
"TypeError: Cannot read properties of undefined (reading 'toISOString')\n at formatRecord (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\core\\app.js:362:75)\n at C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\core\\app.js:390:45\n at Array.map (<anonymous>)\n at options.postProcessResponse (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\core\\app.js:390:31)\n at Client_MySQL.postProcessResponse (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\node_modules\\knex\\lib\\client.js:164:26)\n at C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\node_modules\\knex\\lib\\execution\\runner.js:135:51\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Runner.ensureConnection (C:\\Inetpub\\vhosts\\rope-access-jobs.com\\httpdocs\\node_modules\\knex\\lib\\execution\\runner.js:300:14)\n at async Runner.run (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\node_modules\\knex\\lib\\execution\\runner.js:30:19)\n at async App.exists (C:\\Inetpub\\vhosts\\xxxxxxxxxx.com\\httpdocs\\lib\\validator\\db.js:7:25)"
status
:
"500"
Just one more idea… Every time I have restarted the local and remote NodeJS server after making changes, I haven’t fully rebooted the remote server, I’ll try that now and report back …