Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript jQuery Basics (2014) Introduction to jQuery Include jQuery in a Project

Ian Glencross
Ian Glencross
17,524 Points

When I try and add the line for the CDN I get an error : "Error in precompile" WHY?

This is regardless of whether I use jQuery 1.x ,2.x or 3.x or minified versions

for example :

<script src="https://code.jquery.com/jquery-1.12.4.js" integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU=" crossorigin="anonymous"></script>

I have tried removing the integrity / crossorigin parameters but it doesn't make any difference.

And I am inserting this into the index.html in the correct location - just above the call the js/app.js

index.html
<!DOCTYPE html>
<html>
<head>
    <title>Take Evasive Action</title>
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
    <p class="warning">
      <span>It's A Trap!</span>
    </p>
    <div class="image">
        <img src="img/ackbar.gif">
    </div>
  <script src="https://code.jquery.com/jquery-1.12.4.js" integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU=" crossorigin="anonymous"></script>
    <script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

10 Answers

Jay Padzensky
Jay Padzensky
4,731 Points

Hi folks!

Good news, everyone! I've heard back from our developers that this Code Challenge should now be fixed! Thanks so much for your patience and efforts!

Works for me now! Thank you for the quick action.

Hey Ian,

If you're looking to use a CDN for jQuery, why not use Google Hosted Libraries? Short and simple.

    <!-- 2.x snippet -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    <!-- 3.x snippet -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</body>

As far as your error goes, do you have any more info? Keep in mind that 1.12.4 is a bit dated.

Ian Glencross
Ian Glencross
17,524 Points

I only used the code.jquery.com CDN as it was explicitly specified in the exercise. Regardess though - I tried the googleapi.com as you suggested - same result. What does "Error in precomile" actually mean in this insatnce - I've seen it before in ruby on Rails .. but this is Javascript??

Ian Glencross
Ian Glencross
17,524 Points

Looking a bit deeper : it seems it's a fault with treehouse as several other students are getting the same problem.

Jay Padzensky
Jay Padzensky
4,731 Points

Sorry for any troubles! I've alerted our teaching team about this. Hopefully they'll be investigating it early this week, if not tomorrow. Appreciate the efforts and patience!

bevinwg
bevinwg
5,196 Points

Thank you Jay- I've been stumped by this since last night and frustrated ( The links look quite a bit different now than what is shown in the video- I tried several different as well as exactly what he posted in the video and also keep getting the same response. Please advise once fixed. And thanks!!

I am also getting this same error when trying to complete this task, thank you for bringing it up Ian Glencross. Looking forward to the update Jay Padzensky

bevinwg
bevinwg
5,196 Points

Thanks so much! Just worked for me!

Luis Pedro Juárez Aguilar
Luis Pedro Juárez Aguilar
5,769 Points

I am also getting this error. OCD don;t want to leave this code challenge empty X(

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

If you use the code.jquery.com CDN it should work fine. Let me know how you get on.

Luis Pedro Juárez Aguilar
Luis Pedro Juárez Aguilar
5,769 Points

I can't see this challenge. I guess is under maintenance. but it has been for a month or so. Please let me know when I can take the challenge.

Jay Padzensky
Jay Padzensky
4,731 Points

Hi Luis,

So sorry the CC isn't loading for you- I don't seem to be having any troubles with it on my end. Do you mind emailing Support with a screenshot of what you're seeing and, if possible, the console of the page (via developer's tools). This may shed some light on the issue. Thanks! help@teamtreehouse.com

Luis Pedro Juárez Aguilar
Luis Pedro Juárez Aguilar
5,769 Points

Yes. thank you. I'm having this trouble with all challenges and didn't realize it. I'm sending an e-mail with all the info