Troubleshooting

this page is for errors that we have overcome

404s and HTTP 500 errors

Generally, 404 errors can be resolved by npm installs in the frontend wherever there is a package.json file. You may need to delete generated directories like node_modules & next.. Be sure to check for unsynced fields from ACF too.

500 errors tend to be resolved by running composer install wherever there is a composer.json file.

Here's an instance where typescript saves us.

solved 404 error

This 500 error was caused by on unintentional upgrade to the composer dependency for wp-graphql.

solved 500 error

404's Everywhere

Solution: delete next directory & then run npm install.

Warning: Prop `dangerouslySetInnerHTML` did not match.

Merge Conflicts

for conflicts with build directory

cd backend/plugins/gravity-platform-core/
rm -rf build/
git add .
git commit -m "Removes build files"
git push

New Data Not Showing Up

It seems that the php code takes priority so we need to comment code or the include until we are happy with where it gets then export again.

Can't Access WP Admin from HTTPS/ Can't see block preview

net::ERR_CERT_AUTHORITY_INVALID

I had to delete the certificate from my keychain on Mac. Then, reload Local By Flywheel to generate a new certificate.

My wouldn't work with HTTPS & I couldn't change my password either.

Solution: Update password manually.

Open Adminer

Adminer

select wp_users & update user_pass with a generated MD5 Hash then the string that you put in for your password should work at the login screen for https.

generate MD5 hash

Query Page Data

This can help to see block updates

256 Character Limit Met

directories need to be moved to a shorter path

Plugin error won't let me log in

Rename the directory and login again

Unexpected end of JSON input

get page by slug function error - Error: Unexpected end of JSON input

This was due to plugins not being loaded & activated

Fatal error: Uncaught Error: Call to undefined function WPGraphQL

cd into gravity/backend/plugins/wp-graphql-woocommerce & run composer install

no styles in backend - run npm run build for theme styles in the themes directory > gravity-platform (npm install may be needed as well)

Internal Server Error

This is likely a data problem. There may be data that is returning null breaking the graphql query.

This error happened for me when Local by Flywheel had some sort of db issue & all files were erased. The logo file made it through this check

wp-graphql.php
if (!isset($logo_id) || !absint($logo_id)) {
	return null;
}

These seems like an edge case. But, it does illustrate how missing data can give this Internal Server Error with WPGraphQL.

PHP Version needs update

Request to gravity-platform.local/graphql failed (Apollo Errors)

This manifests in different errors, but it seems to stem from the wrong npm &/or node version. Here is an article on Node Version Manager.

NVM

Putting this here for anyone else that encounters this and gets stumped:nvm keeps switching to the a newer version of node for some reason. Until I can figure out why that’s happening, the solution I’m using to fix it is to kill the dev instance, then:

cd frontend
nvm use
npm run dev

This may error may also be due to a side effect of a particular configuration in Local by Flywheel. If Local's RouterMode is set to localhost rather than Site Domains, this error will occur because graphql will not have the proper path.

more reading on Router Mode

Type 'null' is not assignable to type ReactElement

add non-null assertion operator return null!

Unknown Error??

"SyntaxError: Unexpected token < in JSON at position 0"

Might be Next caching may be confusing things. Delete the .next directory in the frontend folder and restart your compiler.

Git Credentials have expired

generate credentials with this command line tool

IntrinsicAttributes & IntrinsicClassAttributes Errors

119

I solved a lot of "not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes" type of errors just by declaring an object that is passed entirely to the component.

render() {
  const searchBarProps = { // make sure all required component's inputs/Props keys&types match
    term: this.props.term
  }
  return (
    <div className="class">
      ...
      <div>
          <form>
          <SearchBar {...searchBarProps} />
          </form>
      </div>
    </div>
  );

Error : Could not retrieve site globals

For this one, I had to update my frontend .env file. The correct settings are here : https://projects.lapero.io/#/notebooks/413933

Error: missing required src on next image

solution

Error: Please set a page as the Front Page in the WP backend > settings > reading section.

This one turned out to be a data problem too. Particularly ACF Fields. A new field was added without syncing. Solution was to back out the changes, sync first & try again.

Login doesn't work for LocalByFlywheel

update through wp-CLI

update with wp CLI tools

HTTP Error : certificate not trusted

This is due to you Local by Flywheel SSL certificate expiring.

Steps to fix on Mac

Last updated

Was this helpful?