itsjavi / bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
https://itsjavi.com/bootstrap-colorpicker/
MIT License
1.38k stars 367 forks source link

Problems using colorpicker via wejars #268

Closed chess-levin closed 6 years ago

chess-levin commented 6 years ago

Description

I'm trying to use a color-picker dependency via webjars in my gradle buildfile (like any of the other dependencies). Deploying this artefact, the browser can't load jquery anymore. No matter whether the html-pages includes color-picker.js/css or not. After removing the colorpicker depency from the gradle build file, everything works fine again.

Any idea, how to use colorpicker with webjars?

Firefox console output:

Laden fehlgeschlagen für das <script> mit der Quelle "http://localhost:8080/Jenkins2Light/webjars/jquery/jquery.min.js". bridges:24
Error: Bootstrap's JavaScript requires jQuery bootstrap.min.js:6:37
ReferenceError: $ is not defined[Weitere Informationen] bridges:35:9

Context

Gradle buildfile:

    compile group: 'org.webjars', name: 'webjars-locator', version: '0.34'
    compile group: 'org.webjars', name: 'bootstrap', version: '3.3.7'
    compile group: 'org.webjars', name: 'jquery', version: '3.3.1-1'
    compile group: 'org.webjars', name: 'bootbox', version: '4.4.0'
    compile group: 'org.webjars', name: 'ladda-bootstrap', version: '0.1.0'
    //TODO: Fix error: When using dependency colorPicker via webjars client couldn't load jquery anymore
    compile group: 'org.webjars.bower', name: 'bootstrap-colorpicker', version: '2.5.1'

These are the resources included on each webpage:

<link href="webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet">

<script src="webjars/jquery/jquery.min.js"></script>
<script src="webjars/bootstrap/js/bootstrap.min.js"></script>
<script src="webjars/bootbox/bootbox.js"></script>

<link rel="stylesheet" href="webjars/ladda-bootstrap/0.1.0/ladda-themeless.min.css">
<script src="webjars/ladda-bootstrap/0.1.0/spin.min.js"></script>
<script src="webjars/ladda-bootstrap/0.1.0/ladda.min.js"></script>

Expected behavior

{Please write here}

Actual behavior

{Please write here}

Live Example

no

itsjavi commented 6 years ago

Hello, I don't think your problem is related to this project. Maybe the other dependencies you are using are causing this problem.