I am trying to import a CSV file and I am constantly getting a 500 error when it tries to import.
I have done this before and it works fine but now I am getting this error and for the life of me I can not see why!
I have checked the CSV file and all headers are correct and its one I have used elsewhere with success.
The file uploads to the correct folder.
I have designated the correct path.
What on earth would be causing this to occur???
{status: "500", message: "parseCSV: email is missing in undefined",…}
message: "parseCSV: email is missing in undefined"
stack: "Error: parseCSV: email is missing in undefined\n at /opt/node_app/lib/modules/import.js:22:23\n at Array.forEach (<anonymous>)\n at parseCSV (/opt/node_app/lib/modules/import.js:20:24)\n at App.csv (/opt/node_app/lib/modules/import.js:117:16)\n at async App._exec (/opt/node_app/lib/core/app.js:435:30)\n at async App._exec (/opt/node_app/lib/core/app.js:406:17)\n at async App.exec (/opt/node_app/lib/core/app.js:375:9)\n at async App.define (/opt/node_app/lib/core/app.js:365:9)"
status: "500"
It seems not matter what you name the first column and specify in the headers the same error occurs at the first header. Something else is going on here. As you can see the file and the headers are correct?
How do you create this file? Maybe there’s a BOM there which is causing this. I think the script should detect the BOM and ignore it if present, @patrick?
Yeah. If you look at above it uploads the file and adds the ext as specified. The path is selected as specified. There is no issue with file upload and the file is read write access.
Im not doing anything unusual with this file and nothing I haven’t done previously. But it is the first time I have done it with this version of Wappler.
This does look like a BOM issue.
I had a similar issue few years ago in core PHP I think.
The temporary solution I did was add a blank column, and ignore the first column. Because I did not know about BOM then.
@StevenM Try adding a blank column as the first column and see if the import works then.