rakannimer / react-google-charts

A thin, typed, React wrapper over Google Charts Visualization and Charts API.
https://react-google-charts.com/
MIT License
1.58k stars 343 forks source link

Import {chart} from "react-google-charts" Error #299

Open srednakun opened 5 years ago

srednakun commented 5 years ago

I am getting this error when I try to import the charts. I double checked that they were installed and they are located in the node_modules folder. I am using version 3.0.13.

Uncaught TypeError: __webpack_require__.i(...) is not a function at Object../node_modules/react-google-charts/dist/index.esm.js

sreenandanan commented 5 years ago

I'm also facing the same issue,

rakannimer commented 5 years ago

I can't reproduce this issue (locally or on codesandbox), could you please provide a repo with a reproduction of the problem, so I can help debug it ?

srednakun commented 5 years ago

I can't give the repo because it is for a company. Are there any dependencies needed for this package to work? Or any special webpack requirements? If this isn't enough maybe sreenandanan can link their repo. The error says its coming from line 202 in react-google-charts/dist.index.esm

Here's what I'm importing in the page I was trying to use google-react-charts (I'm using D3 components now, so I don't need it anymore, but it would be nice for others trying use it) `//React import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { Chart } from "react-google-charts";

import axios from 'axios';

//Jquery import $ from 'jquery'; import config from '../config';

//Imports from semantic ui import { Grid, Divider, Image, Container } from 'semantic-ui-react';

//Images import HeaderImage from '../images/header.png'; import FooterImage from '../images/logo_DOTSC_small1.png';

//Styling import 'semantic-ui-css/semantic.min.css'; import '../index.css'; import '../css/reports-page.css';

import Utilities, { PtInput, PtInputShort, PtInputIcon, PtSelect, PtDateInput, PtInputConditionTab, PtInputNextToEachOther } from '../grit-utilities'; import ScrollArea from 'react-scrollbar';

//Use D3 components to create charts. var d3 = require('d3'); var BarChart = require('react-d3-components').BarChart;`