Problem with null coalescing operator in 2.6.5 release
See original GitHub issueAPI Platform version(s) affected: 2.6.5
Description
After upgrading from 2.6.4 to 2.6.5 babel in our API Platform app complained about an unexpected token in node_modules
. I think this is because the null coalescing operator from https://github.com/api-platform/admin/commit/0084ae335eab197b6fe7847ad9ac9582274fc2e7#diff-a510ff3025a65f9208998b879111392bde385c82d36cc828b71881751f5ca191R247 is not correctly transpiled in the latest release.
How to reproduce
Currently only can reproduce it locally by upgrading. Before I create a dedicated repo and so I want to rule out that this is just a very simple mistake in the admin build.
Possible Solution
I don’t know enough about babel, but is there more config needed for that? Something related to ES2020 or so maybe?
Additional Context
The exact error is
./node_modules/@api-platform/admin/lib/hydra/dataProvider.js 243:138
Module parse failed: Unexpected token (243:138)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| }
|
> const extraInformation = ((_params$data = params.data) === null || _params$data === void 0 ? void 0 : _params$data.extraInformation) ?? {};
| (_params$data2 = params.data) === null || _params$data2 === void 0 ? true : delete _params$data2.extraInformation;
|
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
https://github.com/facebook/create-react-app/issues/11339 and https://github.com/facebook/create-react-app/issues/11434 might be related, I susbscribed to them and will update this issue if I find out something new.
Changed in 2.6.6.