-
Notifications
You must be signed in to change notification settings - Fork 23
Understanding build errors
During builds you might get a range of errors that will tell you what is broken. This page is a collection of the most common ones with a brief description of those errors and steps to fix them.
If you are running this locally - you'll see errors in the terminal.
If you are building using github (e.g. via pull request), you can find why it fails by clicking the red "X" mark next to failed build message.
Doing so will navigate you to a specific github action execution that should have "build" step in the left menu - click on it.
That should bring up all the build steps on the right side. Find the one with red "X" mark and click it.
Doing so will expand a full text of the build log.
You want to scroll down until you find error messages.
The error log would look something like this:
61 | <div className="flex flex-col">
> 62 | {data.screenshot.map((screen, index) => (
| ^
WebpackError: TypeError: Cannot read property 'map' of null
This error means that the resource is missing specified property (in this case screenshots
).
Updating the resource to include said property will fix the build.
The error log would look something like this:
There was an error in your GraphQL query:
Unknown argument "fromNow" on field "date" of type "MdxFrontmatter".
GraphQL request:17:18
16 | fullDate: date
17 | date(fromNow: true)
| ^
18 | thumbnail
File: src/components/news/index.js:20:18
This means date
property doesn't actually contain dates, so GraphQL cannot do fromNow
operation on it.
Check the date you have used in last added page or resource - there's likely an error in one of them.
The error log would look something like this:
Error parsing projects/Squirrel.ttl! Error: Expected entity but got literal on line 7.
There is an error in your TTL file :)