react-splide: `?.` Module parse failed: Unexpected token

Checks

Version

0.6.5

Description

I only know the ?. syntax from TypeScript and I think that’s the issue here.

ERROR in /node_modules/@splidejs/react-splide/dist/js/react-splide.esm.js 2449:16
Module parse failed: Unexpected token (2449:16)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   }
|   go(control) {
>     this.splide?.go(control);
|   }
|   getSlides() {

Reproduction Link

No response

Steps to Reproduce

  1. Install current react-splide version
  2. Try to build it with webpack using es modules

Expected Behaviour

Should build without error

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16

Most upvoted comments

I transpiled the chaining syntax(^0.6.7).