Skip to content

Build Error #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
14gasher opened this issue Feb 25, 2022 · 2 comments
Open

Build Error #95

14gasher opened this issue Feb 25, 2022 · 2 comments

Comments

@14gasher
Copy link

While building, I get the following error:

failed Building static HTML for pages - 8.205s

 ERROR #95313 

Building static HTML failed

See our docs page for more info on this error: https://gatsby.dev/debug-html

  TypeError: Cannot read properties of null (reading 'split')
  
  - errors.js:102 createErrorFromString
    [road-rally-frontend]/[gatsby-cli]/lib/reporter/errors.js:102:37
  
  - build-html.ts:362 doBuildPages
    [road-rally-frontend]/[gatsby]/src/commands/build-html.ts:362:31
  
  - build-html.ts:450 buildHTMLPagesAndDeleteStaleArtifacts
    [road-rally-frontend]/[gatsby]/src/commands/build-html.ts:450:7
  
  - build.ts:407 build
    [road-rally-frontend]/[gatsby]/src/commands/build.ts:407:5

This only happens when this plugin is being used. It does not occur if the gatsby emotion is being used.

Dependencies if it helps:

"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"gatsby": "^4.6.0",
"gatsby-plugin-material-ui": "4.1.0",
"react": "^17.0.1",
"gatsby-source-filesystem": "^4.6.0"

@14gasher
Copy link
Author

Found more information:

[Error: undefined (from plugin: gatsby-plugin-material-ui)] {
  type: 'RedirectRequest',
  uri: '/user/login',
  unsafeBuiltinsUsage: [],
  context: { path: '/user/', unsafeBuiltinsUsageByPagePath: {} }
}

This is the error logged from gatsby's renderHTMLQueue.

I'm returning Redirects from unauthorized routes. This might be the issue? Removing the redirects made the build work successfully.

@14gasher
Copy link
Author

Replacing all Redirects with navigates wrapped in useEffect makes this work. Would be nice if I could just return a Redirect though haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant