Chart.js: webpack error in latest beta

Created on 2 Nov 2020  ·  2Comments  ·  Source: chartjs/Chart.js

Expected Behavior

I am using the latest chart.[email protected] with angular. Since the update from beta 4 to 5 I get an webpack error during building of the application.

Current Behavior


Module parse failed: Unexpected token (728:30)
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

|               me._config = merge(Object.create(null), [
|                       defaults.controllers[me._type].datasets,
>                       me.chart.options[me._type]?.datasets,
|                       me.getDataset(),
|               ], {

Possible Solution


When I manually remove the optional operator the build works again. So I think it has to do with that.

Steps to Reproduce

Environment

bug

Most helpful comment

Oops, that is a draft: https://tc39.es/ecma262/#prod-OptionalExpression

We should remove that. In the mean time: https://github.com/webpack/webpack/issues/10227

All 2 comments

I am not alone, on my I am using Vuejs 2

Oops, that is a draft: https://tc39.es/ecma262/#prod-OptionalExpression

We should remove that. In the mean time: https://github.com/webpack/webpack/issues/10227

Was this page helpful?
0 / 5 - 0 ratings