Проблемы обновления библиотеки GD 7.2.0 до 7.4.0 - PullRequest
0 голосов
/ 04 мая 2020

Мы обновляем нашу библиотеку GoodData до 7.4.0 (с 7.2.0), и ошибка, которую мы получаем в нашей сборке:

 0=./node_modules/react-intl/lib/components/provider.js 59:15
Module parse failed: Unexpected token (59:15)
File was processed with these loaders:
 * ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js
You may need an additional loader to handle the result of these loaders.
|     return Object.assign(Object.assign({}, resolvedConfig), { formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), formatHTMLMessage: formatHTMLMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
| }
> export default const IntlProvider = /*@__PURE__*/ function () {
|     class IntlProvider extends React.PureComponent {
|         constructor() {
 @ ./node_modules/react-intl/lib/index.js 7:0-76 7:0-76 7:0-76
 @ ./node_modules/@gooddata/react-components/dist/helpers/IntlStore.js
 @ ./node_modules/@gooddata/react-`enter code here`components/dist/components/filters/DateFilter/utils/Translations/DateFilterTitle.js
 @ ./node_modules/@gooddata/react-components/dist/components/filters/DateFilter/index.js
 @ ./node_modules/@gooddata/react-components/dist/index.js
 @ ./.skypagestmp/src/app/public/src/modules/gooddata-chart/gooddata-chart.component.js
 @ ./.skypagestmp/src/app/sky-pages.module.ngfactory.js
 @ ./.skypagestmp/src/app/app.module.ngfactory.js
 @ ./.skypagestmp/src/main-internal.aot.ts
 @ multi ./.skypagestmp/src/main-internal.aot.ts

1 Ответ

0 голосов
/ 05 мая 2020

Из сообщения об ошибке, похоже, проблема связана с react-intl, который был обновлен с 2.4.0 в @gooddata/react-components@7.2.0 до 3.6.0 в @gooddata/react-components@7.4.0. К сожалению, для реакции-intl требуется некоторая миграция в определенном сценарии ios при обновлении с v2 до v3.

Скорее всего, вам потребуется включить библиотеки react-intl в процесс сборки как описано в руководстве по обновлению , добавив следующую конфигурацию в конфигурацию вашего babel-загрузчика (или загрузчика текстов):

include: [
  path.join(__dirname, "node_modules/react-intl"),
  path.join(__dirname, "node_modules/intl-messageformat"),
  path.join(__dirname, "node_modules/intl-messageformat-parser"),
],
...