# "couldn't load script" - "file name doesn't m

**URL:** https://discussions.unity.com/t/couldnt-load-script-file-name-doesnt-m/382126
**Category:** Scripting
**Created:** [June 4, 2008, 6:08pm UTC](https://discussions.unity.com/t/couldnt-load-script-file-name-doesnt-m/382126 "2008-06-04T18:08:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Foxxis](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Foxxis](https://discussions.unity.com/u/Foxxis)
#### Post date: [June 4, 2008, 6:08pm UTC](https://discussions.unity.com/t/couldnt-load-script-file-name-doesnt-m/382126/1 "2008-06-04T18:08:45Z")

</div>

I get this very error in the console, ie: “Couldn’t load the script “Challenge” because its file name doesn’t match the class name.  
Please make sure the file name of the script is the same as the class defined inside it.”

However, I’m using JS and as such these behaviours don’t contain a class name. I get this for _ALL_ my scripts, yet they all still work.

Do I need to care, and if so how do I fix it?

---

<div class="post-metadata">

### Author: ![podperson](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/podperson/32/118057_2.png) [@podperson](https://discussions.unity.com/u/podperson)
#### Post date: [June 4, 2008, 6:15pm UTC](https://discussions.unity.com/t/couldnt-load-script-file-name-doesnt-m/382126/2 "2008-06-04T18:15:12Z")

</div>

In Unity, a script file named “foo.js” implements a class named “foo” (capitalization is important).

It’s odd and worrying that you’re getting these messages unless you’re explicitly loading scripts somewhere.

This means that writing code inside foo.js is similar to creating the class foo and assigning it a bunch of members and methods.

---

<div class="post-metadata">

### Author: ![Foxxis](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Foxxis](https://discussions.unity.com/u/Foxxis)
#### Post date: [June 4, 2008, 6:20pm UTC](https://discussions.unity.com/t/couldnt-load-script-file-name-doesnt-m/382126/3 "2008-06-04T18:20:48Z")

</div>

Sure. But we’re also talking about basic behavior scripts inheriting monobehavior by default.

The ones that are “manual” non-inheriting JS class declarations have matching capitalization, so it’s not user error. 😉

Forgot to mention: I get these in the OSX console log when Unity loads the project, and everything works as it should. Still worried about it though.

---

<div class="post-metadata">

### Author: ![Foxxis](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Foxxis](https://discussions.unity.com/u/Foxxis)
#### Post date: [June 4, 2008, 6:30pm UTC](https://discussions.unity.com/t/couldnt-load-script-file-name-doesnt-m/382126/4 "2008-06-04T18:30:15Z")

</div>

The second time I reimported one of the scripts, the alerts went away - for all of the scripts.

Weird. Will have to keep an eye on it to see if it returns…
