# IndexError when building Space

**URL:** <https://discuss.huggingface.co/t/indexerror-when-building-space/20859>\
**Category:** Spaces\
**Created:** [July 25, 2022, 9:23pm UTC](https://discuss.huggingface.co/t/indexerror-when-building-space/20859 "2022-07-25T21:23:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/johko/32/24763_2.png) [@johko](https://discuss.huggingface.co/u/johko)\
**Post date:** [July 25, 2022, 9:23pm UTC](https://discuss.huggingface.co/t/indexerror-when-building-space/20859/1 "2022-07-25T21:23:57Z")

</div>

Hey,

I created this space: [Haar Cascade Face Detection - a Hugging Face Space by johko](https://huggingface.co/spaces/johko/haar-cascade-object-detection)  
It runs without a problem on my local machine, but on Spaces it fails to build with this error:

```auto
Traceback (most recent call last):
  File "app.py", line 59, in <module>
    Iface = gr.Interface(
  File "/home/user/.local/lib/python3.8/site-packages/gradio/interface.py", line 599, in __init__
    self.examples_handler = Examples(
  File "/home/user/.local/lib/python3.8/site-packages/gradio/examples.py", line 154, in __init__
    self.cache_interface_examples()
  File "/home/user/.local/lib/python3.8/site-packages/gradio/examples.py", line 189, in cache_interface_examples
    raise e
  File "/home/user/.local/lib/python3.8/site-packages/gradio/examples.py", line 185, in cache_interface_examples
    prediction = self.process_example(example_id)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/examples.py", line 201, in process_example
    processed_input = [
  File "/home/user/.local/lib/python3.8/site-packages/gradio/examples.py", line 202, in <listcomp>
    input_component.preprocess(raw_input[i])
IndexError: list index out of range

```

---

<div class="post-metadata">

**Author:** ![johko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/johko/32/24763_2.png) [@johko](https://discuss.huggingface.co/u/johko)\
**Post date:** [July 27, 2022, 6:35pm UTC](https://discuss.huggingface.co/t/indexerror-when-building-space/20859/2 "2022-07-27T18:35:57Z")

</div>

Just found an existing issue for that: [HF API + Spaces give error + uninformative error message · Issue #1643 · gradio-app/gradio · GitHub](https://github.com/gradio-app/gradio/issues/1643)  
So more a Gradio version than really Spaces related topic I guess
