# Conflict between loadShader() and p5 reference?

**URL:** <https://discourse.processing.org/t/conflict-between-loadshader-and-p5-reference/28402>\
**Category:** Beginners\
**Created:** [March 10, 2021, 5:34pm UTC](https://discourse.processing.org/t/conflict-between-loadshader-and-p5-reference/28402 "2021-03-10T17:34:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcela](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@marcela](https://discourse.processing.org/u/marcela)\
**Post date:** [March 10, 2021, 5:34pm UTC](https://discourse.processing.org/t/conflict-between-loadshader-and-p5-reference/28402/1 "2021-03-10T17:34:36Z")

</div>

Hi everyone!

I am trying to have a callback function triggered by a shader loading, but there seems to be something wrong. This is the suggested syntax in the reference:

`loadShader(vertFilename, fragFilename, [callback], [errorCallback])`

but when I try to add any extra arguments, I get this error:

`> p5.js says: loadShader() was expecting no more than 2 arguments, but received 3.[https://github.com/processing/p5.js/wiki/Local-server]`

Any clues to what’s going on?

I also haven’t found any examples or tests in the source code that use that callback function, which makes me think it might not have been tested a lot.

Thanks,  
M

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [March 10, 2021, 7:00pm UTC](https://discourse.processing.org/t/conflict-between-loadshader-and-p5-reference/28402/2 "2021-03-10T19:00:13Z")

</div>

It does seem to be implemented

> <https://github.com/processing/p5.js/blob/main/src/webgl/material.js>

but I haven’t tested it. Did you try with the latest p5.js?

---

<div class="post-metadata">

**Author:** ![marcela](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@marcela](https://discourse.processing.org/u/marcela)\
**Post date:** [March 11, 2021, 12:11pm UTC](https://discourse.processing.org/t/conflict-between-loadshader-and-p5-reference/28402/3 "2021-03-11T12:11:05Z")

</div>

I didn’t 🤦🏻‍♀️  
Thank you!
