layer5io / layer5io/sistent

[ site ]: Error in building `site` locally and CI

Open
#239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/site follow-up kind/bug
Dominant language
TypeScript
Stars
137
Forks
239
Avg merge
4d 14h
Merged PRs (30d)
5

Description

Current Behavior

After forking the gatsby-plugin-dark-mode and making changes, I received this error during the build process.

Currently this is the behavior from running npm run build

Here is the link to the failed job after adding hotfix to resolve react-server-dom-webpack to react@18

https://github.com/layer5io/sistent/actions/runs/6802346260/job/18495246739

Truncated page data information for the failed page "/identity/typography/overview/": {
  "errors": {},
  "path": "/identity/typography/overview/",
  "slicesMap": {},
  "pageContext": {}
}

failed Building static HTML for pages - 1.811s

 ERROR #95313  HTML.COMPILATION

Building static HTML failed for path "/identity/typography/overview/"

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


  635 |     rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
  636 |   let {
> 637 |     basename
      | ^
  638 |   } = React.useContext(UNSAFE_NavigationContext);
  639 |   // Rendered into <a href> for absolute URLs
  640 |   let absoluteHref;


  WebpackError: TypeError: Cannot destructure property 'basename' of 'react__WEBPACK_IMPORTED_MODULE_0__.useContext(...)' as it is null.
Expected Behavior
Screenshots/Logs
Environment
  • Host OS: Mac Linux Windows
  • Platform: Docker or Kubernetes
  • Meshery Server Version: stable-v
  • Meshery Client Version: stable-v

Contributor Guides and Resources

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with npm run build and inspect the /identity/typography/overview/ page along with the linked GitHub Actions job. Trace the react-server-dom-webpack and React 18 resolution involved in the null useContext error. Done means the site builds successfully locally and in CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
build-system, ci-cd, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.