question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`?.` Module parse failed: Unexpected token

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
NaotoshiFujitacommented, Nov 2, 2021

I transpiled the chaining syntax(^0.6.7).

0reactions
jogeshpi03commented, Sep 15, 2022

Could someone help me to get the exact issue here.

./node_modules/@splidejs/react-splide/dist/js/react-splide.esm.js
Module parse failed: Unexpected token (3221:2)
You may need an appropriate loader to handle this file type.
|   children: children2,
|   className,
|   ...props
| }) => {
|   return /* @__PURE__ */React.createElement("div", {
Read more comments on GitHub >

github_iconTop Results From Across the Web

Module parse failed: Unexpected token - Stack Overflow
Apparently it happened because you have two module properties in the webpack config object. Given JS objects can only hold one value per...
Read more >
Module parse failed: Unexpected token. You may ... - GitHub
This is a library build issue. We moved to ts3.8 without thinking about optional chaining transpiling. Here seems like a correct way to...
Read more >
Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
Hello, I am on the “useQuery hook” step attempting to implement the grid. Here is my code that I think is problematic: const...
Read more >
module parse failed: unexpected token (1:0) you may need an ...
Module parse failed: Unexpected token - Stack Overflow ... 1 Answer. Apparently it happened because you have two module properties in the webpack...
Read more >
Module parse failed: Unexpected token (1:0) - Laracasts
Hello , After running npm run watch I see this error : ERROR in ./resources/js/components/irp/admin/EditGroup.vue 1:0 Module parse failed: Unexpected token ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found