Skip to content
New issue

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

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

Already on GitHub? # to your account

error in npm version only: __WEBPACK_IMPORTED_MODULE_2_ra_postgrest_client___default #1

Open
alfonsodev opened this issue Jun 6, 2018 · 1 comment

Comments

@alfonsodev
Copy link

alfonsodev commented Jun 6, 2018

Hello, thank you for creating this package,
I'm trying to use it from npm, but I get the error

TypeError: __WEBPACK_IMPORTED_MODULE_2_ra_postgrest_client___default(...) is not a function

on line

> 16 |     <Admin dataProvider={postgrestClient('http://localhost:3000')}>
import React, { Component } from 'react';
import {
  Admin,
  Resource
} from 'react-admin';
import postgrestClient from 'ra-postgrest-client';
import { UserList } from './user';
import logo from './logo.svg';
import './App.css';

class App extends Component {
  render() {
    return (
    <Admin dataProvider={postgrestClient('http://localhost:3000')}>
        <Resource name="user" list={UserList} />
    </Admin>
    );
  }
}

export default App;

And package.json

{
  "name": "admin",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "aor-postgrest-client": "^0.2.3",
    "ra-postgrest-client": "^0.1.3",
    "react": "^16.4.0",
    "react-admin": "^2.0.2",
    "react-dom": "^16.4.0",
    "react-scripts": "1.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

I can confirm this error only happens if using the npm version

@alfonsodev alfonsodev changed the title postgrestClient error: __WEBPACK_IMPORTED_MODULE_2_ra_postgrest_client___default Jun 6, 2018
@alfonsodev alfonsodev changed the title error: __WEBPACK_IMPORTED_MODULE_2_ra_postgrest_client___default error in npm version only: __WEBPACK_IMPORTED_MODULE_2_ra_postgrest_client___default Jun 6, 2018
@tsingson
Copy link
Owner

i will fix soon.

i m a new one that just try to publish to npm, so some code do not clean up yet.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants