Skip to content

Commit

Permalink
Updates debugging-html instructions
Browse files Browse the repository at this point in the history
includes note about how Gatsby treats all JS files listed in pages directory as page component so the file must export a string or react component
  • Loading branch information
benjaminhoffman authored Nov 4, 2017
1 parent ed05dde commit ad0dc33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/docs/debugging-html-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Errors while building static HTML files generally happen for two reasons.
is building (see code sample below) or b) if the code is in the render
function of a React.js component, move that code into "componentDidMount"
which ensures the code doesn't run unless it's in the browser.

2. Check that each of your JS files listed in your `pages` directory (and any sub-directories) are exporting either a React component or string. Gatsby treats any JS file listed under the pages dir as a page component, so it must have a default export that's a component or string.

2. Some other reason :-) #1 is the most common reason building static files
3. Some other reason :-) #1 is the most common reason building static files
fail. If it's another reason, you have to be a bit more creative in figuring
out the problem.

Expand Down

0 comments on commit ad0dc33

Please sign in to comment.