rrag / react-stockcharts

Highly customizable stock charts with ReactJS and d3
http://rrag.github.io/react-stockcharts
MIT License
3.88k stars 958 forks source link

Error: Cannot find module 'D:\charts\node_modules\@react-financial-charts\annotations\lib\Annotate' imported from D:\charts\node_modules\@react-financial-charts\annotations\lib\index.js #800

Open AmalRichwin-AT opened 2 years ago

AmalRichwin-AT commented 2 years ago

When i have installed the package and tried to run, it throwed this @error.

Error: Cannot find module 'D:\charts\node_modules\@react-financial-charts\annotations\lib\Annotate' imported from D:\charts\node_modules\@react-financial-charts\annotations\lib\index.js

clide7029 commented 2 years ago

I am having this same issue, except I can load the page once fine but then on reload the error will throw.

rnnyrk commented 2 years ago

Same issue for me after reload

c9s commented 2 years ago

Same here

qunaxis commented 2 years ago

Solution for create-react-app provided environment worked for me

  1. Install craco package (https://github.com/gsoft-inc/craco) if it didn't installed before
  2. Insert following config into craco.config.js file (or extend it):
module.exports = {
  webpack: {
    configure: {
      module: {
        rules: [
          {
            test: /\.m?js/,
            resolve: {
              fullySpecified: false,
            },
          },
        ]
      }
    }
  }
}

P.S. It's just a little overriding of default webpack 5 configuration provided by react-scripts@5.0.1 (my currently installed version).

andyevers commented 2 years ago

I had this same issue on my Next.js app while using react-financial charts and was able to solve it with the solution by adamhwang here: https://github.com/react-financial/react-financial-charts/issues/606

You'll need this package: https://github.com/martpie/next-transpile-modules