Skip to content

error in npm version only: __WEBPACK_IMPORTED_MODULE_2_ra_postgrest_client___default #1

@alfonsodev

Description

@alfonsodev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions