# Sortable is not a constructor

**URL:** <https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995>\
**Category:** Help Requests\
**Created:** [October 15, 2019, 8:55pm UTC](https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995 "2019-10-15T20:55:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dammainikilraj](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@dammainikilraj](https://discourse.aurelia.io/u/dammainikilraj)\
**Post date:** [October 15, 2019, 8:55pm UTC](https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995/1 "2019-10-15T20:55:49Z")

</div>

Iam using ‘jquery-sortablejs’

It worked fine in jspm but when i change my project to webpack it throwing below error

‘Sortable is not a constructor’

trying to resolve from long back. could any one help me out on this.

 ![sortable%20error](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/3/3aecf49f8d9c3369e7a5bf2162a5926372441ca8.png)  
Added screen shot for your reference.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [October 16, 2019, 12:03am UTC](https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995/2 "2019-10-16T00:03:10Z")

</div>

Sometimes, jQuery with its plugins in webpack could be a real hassle, especially when you are not familiar with webpack, or something wrong under the hood. I would suggest that for faster development time, move jQuery to global (from script tag usage), and later try to move it back to the bundle if needed.

For your scenario, it would mean something like this:

```auto
<script src="jquery"></script>
<script src="jquery-sortable"></script>

```

hassle free dev environment

---

<div class="post-metadata">

**Author:** ![Alfhir](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/alfhir/32/1510_2.png) [@Alfhir](https://discourse.aurelia.io/u/Alfhir)\
**Post date:** [October 16, 2019, 3:12pm UTC](https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995/3 "2019-10-16T15:12:59Z")

</div>

Hi @bigopon,

im kind of late to frontend development (joined after when jQuery was the thing).  
What´s wrong with importing 3rd-party libs anyway - besides global namespace and no treeshaking / importing only stuff one really needs.  
Just curious…

Best

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [October 17, 2019, 11:50am UTC](https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995/4 "2019-10-17T11:50:38Z")

</div>

There’s nothing wrong with jQuery at all. I was only suggesting an option to minimize the number of things to need to juggle at once to get the dev workflow smooth at first. If I remember correctly, jQuery supports UMD module format, which means you won’t leak jQuery into global, if the build is configured properly

---

<div class="post-metadata">

**Author:** ![Alfhir](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/alfhir/32/1510_2.png) [@Alfhir](https://discourse.aurelia.io/u/Alfhir)\
**Post date:** [October 17, 2019, 12:10pm UTC](https://discourse.aurelia.io/t/sortable-is-not-a-constructor/2995/5 "2019-10-17T12:10:57Z")

</div>

Sorry, I meant to write “what´s wrong with importing via scripttag”?  
Is it mainly because of the global, right?

Considering the “hassle-free” dev-option - i´ll definately give that a shot, when trying new things.  
Thanks a lot!
