Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

authClient causing errors #2

Closed
RWOverdijk opened this issue Jul 11, 2017 · 2 comments
Closed

authClient causing errors #2

RWOverdijk opened this issue Jul 11, 2017 · 2 comments
Assignees
Labels

Comments

@RWOverdijk
Copy link
Contributor

When using authClient I get the following error:

TypeError: __webpack_require__.i(...) is not a function
App
src/App.js:19
  16 | const trackedResources = ['configs'];
  17 | 
  18 | const App = () => (
> 19 |   <Admin restClient={RestClient(trackedResources, firebaseConfig)} authClient={AuthClient(firebaseConfig)}>
  20 |     <Resource name="Configs" list={ConfigList} edit={ConfigEdit} />
  21 |   </Admin>
  22 | );
View compiled

It works when removed. My code is really simple:

// in src/App.js
import React from 'react';
import {Admin, Resource} from 'admin-on-rest';
import {ConfigList, ConfigEdit} from './config';
import {RestClient, AuthClient} from 'aor-firebase-client';

const firebaseConfig = {
};

const trackedResources = ['configs'];

const App = () => (
  <Admin restClient={RestClient(trackedResources, firebaseConfig)} authClient={AuthClient(firebaseConfig)}>
    <Resource name="Configs" list={ConfigList} edit={ConfigEdit} />
  </Admin>
);

export default App;
@sidferreira sidferreira self-assigned this Jul 11, 2017
@RWOverdijk
Copy link
Contributor Author

RWOverdijk commented Jul 12, 2017

I think the issue is that you shouldn't call it as a method, but just pass it in:

const App = () => (
  <Admin restClient={RestClient(trackedResources, firebaseConfig)} authClient={AuthClient}>
    <Resource name="Configs" list={ConfigList} edit={ConfigEdit} />
  </Admin>
);

Update:

I tested this using my own client (I need a provider) and it works fine.

@sidferreira
Copy link
Owner

@RWOverdijk you were right! Thanks a lot!

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

No branches or pull requests

2 participants