webpack failing since highcharts 11.2.0
thomasleveil opened this issue · comments
Hi,
I updated the dependencies on my project and webpack now fails since highcharts 11.2.0. If I pin down highcharts to 11.1.0, my project builds correctly.
I see in the highcharts changelog that 11.2.0 introduced the following change :
Upgraded the build pipeline to benefit from new language features. Bundles are now compiled to ES2020 by the TypeScript compiler (.src.js files), and minified by swc (.js files).
I wonder if this change is the reason using highcharts-vue in a webpack project now fails.
WAIT Compiling... 14:24:29
98% after emitting CopyPlugin
ERROR Failed to compile with 1 error 14:24:30
error in ./node_modules/highcharts/highcharts.js
Module parse failed: Unexpected token (8:5207)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| * License: www.highcharts.com/license
| */!function(t,e){"object"==typeof module&&module.exports?(e.default=e,module.exports....
Thanks for reporting @thomasleveil!
I will investigate this issue this week. In the meantime, could you please share more details about your environment?
- which version of Node, npm are you using?
- which version of
highcharts-vue
are you using? - how are you building your project?
- could you please share your
package.json
config?
Thanks in advance!
Here are my versions :
- node v20.8.1
- highcharts-vue 1.4.3
we are building using vue-cli, so in the end the command isvue-cli-service serve
.
I cannot share my code as this is not a personal project
same problem
Thanks! I'm currently looking into this problem and will try to propose a solution (or at least a workaround) by the end of the next week.
You pointed out correctly that the most probable cause of this issue is the following update:
Upgraded the build pipeline to benefit from new language features. Bundles are now compiled to ES2020 by the TypeScript compiler (.src.js files), and minified by swc (.js files).
It seems to me, however, that this issue is unrelated to the highcharts-vue
package, but more to the highcharts
package. Either way, I will try to help you solve this issue. Could you please share your webpack config so I can take a look?
It might be the case that your webpack configuration does not support the ES2020 format.
By updating your webpack setup and ensuring it can handle ES2020 features, you should be able to resolve the issue and successfully build your project with Highcharts 11.2.0.
We are getting the same issue