Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleFieldList : Cannot read property 'map' of undefined #4931

Closed
AntoineAwaida opened this issue Jun 11, 2020 · 4 comments
Closed

SingleFieldList : Cannot read property 'map' of undefined #4931

AntoineAwaida opened this issue Jun 11, 2020 · 4 comments

Comments

@AntoineAwaida
Copy link

AntoineAwaida commented Jun 11, 2020

I have a List which contains a column as ArrayField, with SingleFieldList inside.

This morning all was going well, but I pushed on my server my platform for deployment ; however on launch, I noticed that all Lists of resources containing ArrayFields with SingleFieldList inside crashed, with SingleFieldList : Cannot read property 'map' of undefined uncaught error.

What you were expecting:
That the list would be displayed.

I thought it would be the same issue that ids one (#4916), but the PR fix didn't work.

What happened instead:
List doesn't appears, with "A problem has occured" error.

Steps to reproduce:

Go to admin.hublo.eu with these credentials
See that abonnements page crashes (db is still empty in other resources, but on local version it works)

Related code:

export const AbonnementList = (props) => (
  <List {...props} filters={<FullFilter />}>
    <Datagrid rowClick='edit'>
      <TextField source='id' />
      <TextField source='name' />
      <TextField source='price' />
      <TextField label='Période de facturation' source='pricePeriod' />
      <TextField label="Période d'octroi des crédits" source='offeredPeriod' />

      <ArrayField source='descriptions'>
        <SingleFieldList linkType={false}>
          <TextField source='description'></TextField>
        </SingleFieldList>
      </ArrayField>
      <EditButton />
    </Datagrid>
  </List>
);

https://github.com/DeciusAntiochus/Hublo-admin

Environment

  • React-admin version: 3.6.0
  • Last version that did not exhibit the issue (if applicable): 3.5.3
  • React version: 16.13.1
  • Browser: Vivaldi & Safari
  • Stack trace (in case of a JS error):
    Uncaught TypeError: Cannot read property 'map' of undefined
    at SingleFieldList (SingleFieldList.js:88)
    at renderWithHooks (react-dom.development.js:14803)
    at mountIndeterminateComponent (react-dom.development.js:17482)
    at beginWork (react-dom.development.js:18596)
    at HTMLUnknownElement.callCallback (react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
    at invokeGuardedCallback (react-dom.development.js:292)
    at beginWork$1 (react-dom.development.js:23203)
    at performUnitOfWork (react-dom.development.js:22154)
    at workLoopSync (react-dom.development.js:22130)
    at performSyncWorkOnRoot (react-dom.development.js:21756)
    at react-dom.development.js:11089
    at unstable_runWithPriority (scheduler.development.js:653)
    at runWithPriority$1 (react-dom.development.js:11039)
    at flushSyncCallbackQueueImpl (react-dom.development.js:11084)
    at flushSyncCallbackQueue (react-dom.development.js:11072)
    at batchedUpdates$1 (react-dom.development.js:21862)
    at Object.notify (Subscription.js:19)
    at Subscription.notifyNestedSubs (Subscription.js:92)
    at Subscription.handleChangeWrapper (Subscription.js:97)
    at dispatch (redux.js:222)
    at middleware.js:22
    at redux-saga-core.esm.js:1410
    at useDataProvider.js:359
@djhi
Copy link
Collaborator

djhi commented Jun 12, 2020

Please provide a CodeSandbox reproducing your error, based on our simple example.

@AntoineAwaida
Copy link
Author

https://codesandbox.io/s/hublo-admin-ejm4u

This is my code, please use the above credentials in order to access the platform.

@djhi
Copy link
Collaborator

djhi commented Jun 12, 2020

We don't have the time to help you debug your application. You can either provide the most simple possible codesandbox based on our simple example to show the issue, or contact Marmelab for professional services.

@djhi djhi closed this as completed Jun 12, 2020
@AntoineAwaida
Copy link
Author

Sorry, wasn't able to reproduce it with your sandbox.

Just replaced SingleFieldList with Datagrid and it worked fine.
I'll try to investigate if I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants