# WebpackError: TypeError: Cannot read property 'url' of undefined

**URL:** <https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534>\
**Category:** Developing with Prismic\
**Tags:** gatsby\
**Created:** [May 26, 2020, 5:58pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534 "2020-05-26T17:58:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![magallen.fc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/magallen.fc/32/153_2.png) [@magallen.fc](https://community.prismic.io/u/magallen.fc)\
**Post date:** [May 26, 2020, 5:58pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534/1 "2020-05-26T17:58:44Z")

</div>

Hi Prismic people, I encountered an issue while running build command.

> WebpackError: TypeError: Cannot read property 'url' of undefined

I am using Gatsby and gatsby-source-prismic in this project.

`<img src={node.data.thumbnail.url} alt="" />`

I have no idea why url is undefined coz it's already added in the query to a page where it needs to be displayed.

Running develop command has no issue.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [May 27, 2020, 1:58pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534/4 "2020-05-27T13:58:27Z")

</div>

Hi there,

Thank you for contacting us, I guess this issue is related to the way you are accessing Prismic content.

As you know Gatsby is a static website generator, and when building your website using gatsby-source-prismic plugin; your Gatsby project fetches your content from Prismic.

And if you don’t have a content available in your Prismic repository then your application breaks.

Here is an [full exmaple](https://prismic.io/docs/gatsby/rendering/rendering-links-or-content-relationship-fields#11_0-a-full-example) of how to retrieve image link with Gatsby with the right validation, please notice the usage of `if (!prismicContent) return null`

Please let us know if that doesn’t answer your question,

Fares

---

<div class="post-metadata">

**Author:** ![magallen.fc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/magallen.fc/32/153_2.png) [@magallen.fc](https://community.prismic.io/u/magallen.fc)\
**Post date:** [May 27, 2020, 2:00pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534/5 "2020-05-27T14:00:53Z")

</div>

Hey, thanks for your response.  
Just figured out where the issue really came from using cypress and already managed to solve the issue.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [May 27, 2020, 2:07pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534/6 "2020-05-27T14:07:34Z")

</div>

Ok, thanks for letting us know.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [September 15, 2020, 4:55pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534/7 "2020-09-15T16:55:45Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:37pm UTC](https://community.prismic.io/t/webpackerror-typeerror-cannot-read-property-url-of-undefined/534/8 "2021-12-09T17:37:56Z")

</div>


