EdisonPeM / strapi-plugin-import-export-content

Csv and Json import / export content plugin to Strapi
https://www.npmjs.com/package/strapi-plugin-import-export-content
MIT License
146 stars 66 forks source link

[Solved] No Items Imported #46

Open pikonha opened 3 years ago

pikonha commented 3 years ago

I've came across this error message when importing a csv file: No Items Imported.

As this does not provide any feedback on what's going wrong in the import process, I had to investigate by myself. What did expose the errors that were happening was the console.error in this file:

node_modules/strapi-plugin-import-export-content/services/importer/importUtils.js

const importToCollectionType = async (uid, item) => {
  try {
    await strapi.entityService.create({ data: item }, { model: uid });
    // await strapi.query(uid).create(item);
    return true;
  } catch (error) {
    console.error({e: error.data.errors})
    return false;
  }
};

Hope this helps anyone having the same issue. Wish y`all the best.