Build fails only on Netlify: TypeError: Cannot read property 'title' of undefined
- Dominant language
- JavaScript
- Stars
- 8.5k
- Forks
- 466
- PR merge metrics
- No merged PRs in 30d
Description
I'm having issues with a build failing on Netlify that works fine locally. I'm doing the same exact thing for other content types in my site, and it all works fine. And again, *everything* works just fine locally.
It seems like just as much of a Gridsome issue as a Netlify issue, so I'm going to give it a shot here. Please let me know if I should move this question to a better category.
My main goal here is to figure out what's different about the local environment and the Netlify build environment. I'm running Node 10.16.3 locally.
The most confusing part is that this works:
```js
{{ $page.meetingPage }}
```
But this does not:
```js
{{ $page.meetingPage.title }}
```
This is the build error:
**`10:37:11 AM: TypeError: Cannot read property 'title' of undefined`**
My template:
```html
This is the page template
{{ $page.meetingPage.title }}
{{ $page.meetingPage.subtitle }}
{{ $page.meetingPage }}
```
My query:
```gql
query MeetingPage ($path: String!) {
meetingPage (path: $path) {
id
title
subtitle
description
content
}
}
```
Fine in GraphQL explorer locally:

Fine in the browser locally:

Fine in Vue devtools locally:

In case it matters, here's netlify.toml:
```toml
[build]
command = "yarn run build"
publish = "dist"
functions = "src/functions"
NODE_ENV = "10.16.3"
[dev]
command = "yarn run develop"
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.