Gatsby: [gatsby-source-wordpress] Possible to use local WordPress installation (ideally running in Local by Flywheel)?

Created on 19 Jun 2018  Â·  8Comments  Â·  Source: gatsbyjs/gatsby

Summary

Relevant information

I've successfully used gatsby-source-wordpress with a remote WordPress install, but am interested in working with a local installation for quicker development. I'm trying out Local by Flywheel, and have Wordpress running at remind.local, but when running with

baseUrl: 'remind.local',

I get:

â ˆ source and transform nodesThe request failed with error code "DEPTH_ZERO_SELF_SIGNED_CERT"
No routes to fetch. Ending.

Not sure if this points to an issue/incompat with gatsby-source-wordpress, or with Local.

Environment (if relevant)

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.6.0 - ~/n/bin/node
    Yarn: 1.7.0 - ~/n/bin/yarn
    npm: 5.3.0 - ~/n/bin/npm
  Browsers:
    Chrome: 67.0.3396.87
    Safari: 11.1.1
  npmPackages:
    gatsby: ^1.9.272 => 1.9.272
    gatsby-image: ^1.0.54 => 1.0.54
    gatsby-link: ^1.6.40 => 1.6.44
    gatsby-plugin-postcss-sass: ^1.0.22 => 1.0.22
    gatsby-plugin-react-helmet: ^2.0.10 => 2.0.11
    gatsby-plugin-react-next: ^1.0.11 => 1.0.11
    gatsby-plugin-resolve-src: 1.1.3 => 1.1.3
    gatsby-source-wordpress: ^2.0.92 => 2.0.92
  npmGlobalPackages:
    gatsby-cli: 1.1.58
question or discussion

Most helpful comment

Was able to get around this by adding the following to gatsby-node.js:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

Going to leave this open for a bit just to see if others have solved it differently.

The build seems a bit slower on my local, bare installation than my remote installation with a dozen pages & about 50-60 posts which seems really odd.

All 8 comments

Was able to get around this by adding the following to gatsby-node.js:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

Going to leave this open for a bit just to see if others have solved it differently.

The build seems a bit slower on my local, bare installation than my remote installation with a dozen pages & about 50-60 posts which seems really odd.

It looks like Local is creating a self-signed SSL certificate which has caused the DEPTH_ZERO_SELF_SIGNED_CERT error. Your workaround seems good. If no one else has any suggestions would you like to update the troubleshooting docs for gatsby-source-wordpress to include info about dealing with self-signed SSL certs?

It does seem odd that the build is slower with a local instance of WordPress. I wonder if Local is running WordPress in development mode, and if that results in WordPress taking longer to process requests?

It does seem odd that the build is slower with a local instance of WordPress. I wonder if Local is running WordPress in development mode, and if that results in WordPress taking longer to process requests?

It does by default. When I was using it ~1 year ago there was switch to disable dev/debug mode for a site in Local UI

Will add a note to the docs, and look into that tip about dev mode—thanks.

Did try toggling 'Dev mode' in Local, but didn't discern any difference. Going to continue to try to debug.

Seems like You resolved issue of this not working with https://github.com/gatsbyjs/gatsby/pull/6061 . As far as this being slow I think this is something to report / investigate with Local and has nothing to do with gatsby-source-filesystem, so I'll close this issue

@dustinhorton did you find any more info about the slower local WordPress builds? It seems someone else has run into that over at https://spectrum.chat/thread/b67dc4e1-9c2b-4c25-8f69-ee33decb3b12

I didn't—had some issues migrating a DB to my local instance so bailed on it for a bit. Will pick it up again shortly if you have any tips on how I can provide some useful info.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  Â·  3Comments

theduke picture theduke  Â·  3Comments

ferMartz picture ferMartz  Â·  3Comments

ghost picture ghost  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments