bvaughn / react-virtualized-auto-sizer

Standalone version of the AutoSizer component from react-virtualized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Module parse failed: Unexpected token` error

yorch opened this issue · comments

Upgrading to 1.0.12 causes a build error due to nullish coalescing operator ?? introduced in ccb88dd#diff-89386aae2ac82c8ec4a0d1367a57061c8abc02b01921b7db3bc139959a5778b7R187-R190

ERROR in /app/node_modules/react-base-table/node_modules/react-virtualized-auto-sizer/dist/react-virtualized-auto-sizer.module.js 236:56
Module parse failed: Unexpected token (236:56)
File was processed with these loaders:
 * ../../node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|         // See issue #150 for more context.
|         const style = window.getComputedStyle(this._parentNode) || {};
>         const paddingLeft = parseInt(style.paddingLeft ?? "0", 10);
|         const paddingRight = parseInt(style.paddingRight ?? "0", 10);
|         const paddingTop = parseInt(style.paddingTop ?? "0", 10);
 @ /app/node_modules/react-base-table/es/AutoResizer.js 3:0-53 29:29-38
 @ /app/node_modules/react-base-table/es/index.js
 @ ./src/components/Table.tsx
...
 @ multi /app/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js /app/node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.tsx

Should it be transpiled when building this library?

Thanks

+1 I started experiencing this today too

PR to fix it: #54

Fixed published as react-virtualized-auto-sizer@1.0.13

Thanks!