tiny-slider: Unexpected String issue when importing the slider in React (Gatsby)

I’m importing the slider in a statically generated site using default GatsbyJS installation, it’s built using React and I’m getting the following error:

Uncaught SyntaxError: Unexpected string - commons.js:54025

It’s referring to the following section:

/***/ "./node_modules/ventura-slider/src/tiny-slider.module.js":
/***/ (function(module, exports) {
	// Format: ES MODULE
	// Version: 2.5.2
	// helper functions 
	import './helpers/keys';
	import './helpers/childNode.remove';

Any ideas?

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 3
  • Comments: 21 (3 by maintainers)

Most upvoted comments

I’m experiencing this issue as well. Maybe the message in the following screenshot helps image

I have the same issue. There is a workaround, require tns inside useEffect hook.

  useEffect(() => {
    require('tiny-slider/src/tiny-slider').tns({
      container: '.client-feedback-slider',
      items: 2,
      autoplay: true
    });
  }, []);

Any news about this? I’m having the same issue : (