# jQuery asset still requested after main bundle load

**URL:** <https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213>\
**Category:** StealJS\
**Created:** [April 4, 2016, 11:05pm UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213 "2016-04-04T23:05:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunstepanowich](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@shaunstepanowich](https://forums.bitovi.com/u/shaunstepanowich)\
**Post date:** [April 4, 2016, 11:05pm UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213/1 "2016-04-04T23:05:27Z")

</div>

Test Case: [https://github.com/shaunstepanowich/stealjs-jquery-issue](https://github.com/shaunstepanowich/stealjs-jquery-issue)

Notes:

1. This test is based almost 100% on stealjs quick start guide
2. Main difference is the express server.
3. Pretty much all configuration is coming right out of NPM

Test Case is a nodejs app using express as the web server.

Steps:

1. Clone repo, run npm install
2. Run: grunt build
3. Run: node app.js (server is on localhost:8080)
4. In console in browser you’ll note the following:  
localhost:8080/dist/bundles/main.js (successful request)  
localhost:8080/jquery.js (404 request)

---

<div class="post-metadata">

**Author:** ![phillipskevin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/phillipskevin/32/102_2.png) [@phillipskevin](https://forums.bitovi.com/u/phillipskevin)\
**Post date:** [April 5, 2016, 2:32am UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213/2 "2016-04-05T02:32:46Z")

</div>

I think the main issue is that since you are loading steal from /steal, it does not know to use the NPM plugin.

One way to fix this is to change this line in your app.js

```auto
app.use('/steal',express.static(__dirname + '/node_modules/steal/'));

```

to

```auto
app.use('/node_modules', express.static(__dirname + '/node_modules/'));

```

and then change you Index.html to load steal from node\_modules:

```auto
<script src="/node_modules/steal/steal.production.js" type="text/javascript" data-main="main"></script>

```

There are other ways to do this by setting configMain to `package.json!npm` (see [here](http://stealjs.com/docs/npm.html)), so that you don’t have to expose all of node\_modules. You may need to set other config options as well to get it to work though so it might be a little more complex.

---

<div class="post-metadata">

**Author:** ![shaunstepanowich](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@shaunstepanowich](https://forums.bitovi.com/u/shaunstepanowich)\
**Post date:** [April 5, 2016, 4:26am UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213/3 "2016-04-05T04:26:29Z")

</div>

Hi Kevin,

Thanks this helps a lot. I tried your suggestion and it did appear to work (in the test case at least)

I also took the steal.production.js file and put it into my own directory and then made it look like a node\_modules directory:

app.use(’/node\_modules/steal/’, express.static(\_\_dirname + ‘/modules/steal/’));

This also seems to be working.

Is it really standard practice to expose node\_modules directory as part of a web application, this seems very strange to me?

Thanks again.

---

<div class="post-metadata">

**Author:** ![pYr0x](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/pyr0x/32/95_2.png) [@pYr0x](https://forums.bitovi.com/u/pYr0x)\
**Post date:** [April 5, 2016, 7:30am UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213/4 "2016-04-05T07:30:57Z")

</div>

you dont need to upload node\_modules to your server. there a two ways:

- make a build and bundle steal into the output file [http://stealjs.com/docs/steal-tools.build.html](http://stealjs.com/docs/steal-tools.build.html) (bundleSteal=true)
- use steal-production, you can upload steal to very folder. **but** carefull, you have to specify a `baseURL´ in your script tag [http://stealjs.com/docs/System.baseURL.html](http://stealjs.com/docs/System.baseURL.html)

---

<div class="post-metadata">

**Author:** ![matthewp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/matthewp/32/77_2.png) [@matthewp](https://forums.bitovi.com/u/matthewp)\
**Post date:** [April 5, 2016, 12:47pm UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213/5 "2016-04-05T12:47:55Z")

</div>

@shaunstepanowich In development yes, we cannot load node\_modules unless it is exposed. After you’ve done a build with steal-tools it will not need to have node\_modules exposed.

---

<div class="post-metadata">

**Author:** ![shaunstepanowich](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@shaunstepanowich](https://forums.bitovi.com/u/shaunstepanowich)\
**Post date:** [April 5, 2016, 6:46pm UTC](https://forums.bitovi.com/t/jquery-asset-still-requested-after-main-bundle-load/213/6 "2016-04-05T18:46:30Z")

</div>

Alright,

Thanks everyone.
