react-splide: `?.` Module parse failed: Unexpected token
Checks
- Not a duplicate.
- Not a question, feature request, or anything other than a bug report directly related to React Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions
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
- Install current react-splide version
- 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
I transpiled the chaining syntax(^0.6.7).