question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsupported fetch action type createMany

See original GitHub issue

When I tried to use the import function, I am seeing:

Unsupported fetch action type createMany

could you please provide an example of how to implement createMany

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
benwindingcommented, Apr 19, 2022

Version 1.0.31 should fix the issue here. The new version should automatically handle those additional error cases.

But if you’re still getting an error from createMany try disabling it by using disableCreateMany in the options.

Let me know if there’s any issues

1reaction
a3626acommented, Mar 31, 2022

Implementing CreateMany is always better than relying on the fallback. However, in some cases CreateMany is not supported at api(server) level. In those cases, implementing CreateMany is just repeating this code : https://github.com/benwinding/react-admin-import-csv/blob/9b7b840f76270fe7c444710881ed781a8d83c830/src/uploader.ts#L106-L123

Therefore, I think relying on the fallback is better if the api server does not support CreateMany. Fallback condition depends on the error raised, Unknown dataProvider : https://github.com/benwinding/react-admin-import-csv/blob/9b7b840f76270fe7c444710881ed781a8d83c830/src/uploader.ts#L147

Error message for missing data provider function varies depending on data provider implementations. So in many cases, this fallback does not work without additional implmentations. In my case, I catch error from the data provider and throw “Unknown dataProvider”.

try {
  ...
} catch (error) {
    if (error.toString().includes("Unsupported Data Provider")) {
        throw "Unknown dataProvider"
    } else {
        throw error;
    }
}

Making fallback work for various data provider implementions looks like difficult. Because there are no protocol to signal missing data provider functions in react admin. I think providing a tutorial for this would be the best.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The DataProvider action "createMany" isn't documented ...
Problem The createMany doesn't seem to be documented anywhere: It doesn't seem t... ... Unsupported fetch action type createMany ...
Read more >
React-admin component does not use dataprovider to call api
I should get a JSON back with 1 element from the api, something like this: {count: 0} , so i just set this.setState({...
Read more >
Prisma Client API (Reference)
createMany creates multiple records in a transaction. Options. Name, Type, Required, Description ...
Read more >
Tickets - Zendesk Developer Docs
Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support. Tickets can originate from a number of...
Read more >
Instantiating Prefabs at run time - Unity - Manual
You can use code to create many copies of a Prefab in a particular ... on the projectile Prefab) performs the action of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found