three-stdlib: Failed to Compile due to Module parse failed: Unexpected token

  • three version: ^0.132.2
  • three-stdlib version: ^2.4.1

Problem description:

When I set up a new project and run it. The compiler gives this error:

./node_modules/three-stdlib/exporters/ColladaExporter.js 127:20 Module parse failed: Unexpected token (127:20) 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. | | return res; > }).join(‘\n’)) ?? ‘’; | } // Convert an image into a png format for saving |

Suggested solution:

i tried to install esm later but it dosen’t work.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Also getting this on a new CRA app. I’d set the threshold for pollyfilling/transpiling as “does this work on stock CRA?”

i think that makes sense. i’ll make the changes

Also getting this on a new CRA app. I’d set the threshold for pollyfilling/transpiling as “does this work on stock CRA?”

I also got the error in a simple CRA app. I fixed the issue by adding @babel/plugin-proposal-nullish-coalescing-operator on the craco config file.

// craco.config.js
module.exports = {
  babel: {
    plugins: ["@babel/plugin-proposal-nullish-coalescing-operator"],
  },
};