B
B
Bohdan Zhorov2019-05-20 14:44:57
Owl Carousel
Bohdan Zhorov, 2019-05-20 14:44:57

How to fix owl-carousel error?

Installed owl via npm. When I write the standard code:

$('.owl-carousel').owlCarousel({
    loop:true,
    margin:10,
    nav:true,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:3
        },
        1000:{
            items:5
        }
    }
})

I am getting an error:
ERROR in ./node_modules/owl.carousel/dist/assets/owl.video.play.png 1:0
    Module parse failed: Unexpected character '�' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/owl.carousel/dist/assets/owl.carousel.css (./node_modules/css-loader/dist/cjs.js!./node_modules/owl.carousel/dist/assets/owl.carousel.css) 4:41-72

Here are all index.js imports:
import './css/index.css'
import './sass/index.sass'
import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'owl.carousel/dist/assets/owl.carousel.css';
import 'owl.carousel';
import 'jquery'

webpack:
const path = require('path')
const HTMLPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const webpack = require('webpack')

How to fix, the HTML markup is the same as in the example.
I also tried to comment out the line in the owl sources, the error disappeared, but the carousel does not work correctly
5ce2930633b75561091164.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2019-05-20
@tyzberd

https://github.com/OwlCarousel2/OwlCarousel2/issue...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question