I have a react app with ipfs as an npm installation. When I try to compile my project I get the following error:
Failed to compile
./node_modules/ipfs-core/src/components/add-all/index.js 201:35
Module parse failed: Unexpected token (201:35)
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.
| // Pin a file if it is the root dir of a recursive add or the single file
| // of a direct add.
> const isRootDir = !file.path?.includes('/');
| const shouldPin = (opts.pin == null ? true : opts.pin) && isRootDir && !opts.onlyHash;
I can confirm the same browser that can run code with the optional chaining operator will also show the same error.
I’m using react as suggested. I’ll try using a more recent version of create react app. I’m using version 4.0.3 according to npx create-react-app --version.