abarthdew / highcharts-gpt-chatbot

👽Highcharts using gpt chatbot📈📊
https://abarthdew.github.io/highcharts-gpt-chatbot/
0 stars 1 forks source link

npm highchart install&error #1

Open abarthdew opened 1 year ago

abarthdew commented 1 year ago
$ npm i --save vue3-highcharts

error

✘ [ERROR] Could not resolve "highcharts"

    node_modules/highcharts-vue/dist/highcharts-vue.min.js:1:90:
      1 │ ...?module.exports=e(require("highcharts"),require("vue")):"functio...
        ╵                              ~~~~~~~~~~~~

  You can mark the path "highcharts" as external to exclude it from the bundle,
  which will remove this error. You can also surround this "require" call with a
  try/catch block to handle this failure at run-time instead of bundle-time.

solution

Excluding highcharts via optimizeDeps.exclude would clear the error, but that would defeat your ultimate goal of using highcharts in your project. You'll notice that after using that config, your project still is not able to import highcharts. The error is indicating that your project is missing that dependency. The solution would be to install highcharts: => references

$ npm install -S highcharts

conclusion

$ npm i --save vue3-highcharts
$ npm install -S highcharts