Skip to content

Error on .csv import: ENOENT: no such file or directory, open 'filename.csv' #8

@ardnaskela

Description

@ardnaskela

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions