-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Describe the bug
When importing a .csv file into a table, it fails with error 500, log message: Error on .csv import: ENOENT: no such file or directory, open 'filename.csv'. Export is working file. Tried on Windows 10 and Zorin OS 16.1 Lite.
Installed libraries and their versions
"@adminjs/express": "^5.0.0",
"@adminjs/import-export": "^2.0.0",
"@adminjs/nestjs": "^5.0.0",
"@adminjs/prisma": "^3.0.1"
To Reproduce
Follow the steps to create a basic NestJS/Prisma project: https://docs.nestjs.com/recipes/prisma
Install AdminJs and its dependencies for NestJS: https://docs.adminjs.co/module-@adminjs_nestjs.html
Install AdminJs and its dependencies for Prisma: https://docs.adminjs.co/module-@adminjs_prisma.html
Install AdminJs import-export: https://www.npmjs.com/package/@adminjs/import-export
Create the following AdminJs resource:
{
resource: {
model: dmmf.modelMap.Post,
client: prisma
},
features: [importExportFeature()],
}
Create a simple import.csv file and place it under /home/username/Documents on an Ubuntu-based Linux or under Documents on Windows 10:
title,content,published,author
Test Title,Test Content,true,
Launch AdminJs dashboard, Posts section and try to import the file. It gives the following error:
Error: ENOENT: no such file or directory, open 'filename.csv'