question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Failed exporting HTML for URL About (src/pages/About.js): Cannot read property 'href' of undefined

See original GitHub issue

I just updated to react-static@v6.0.0-beta.16, and now yarn build will throw the following error for any file that my pages folder will contain:

TypeError: Failed exporting HTML for URL About (src/pages/About.js): Cannot read property 'href' of undefined

Environment

  1. react-static -v: 6.0.0-beta.16
  2. node -v: 8.10.0
  3. yarn --version: 1.6.0
  4. Operating system: macOS High Sierra

Steps to Reproduce the problem

Base your steps off of any freshly installed react-static template!

  1. yarn add react-static@v6.0.0-beta.16
  2. yarn build

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
E-Wagnercommented, Apr 25, 2019

@tannerlinsley I’m having the same issue, would you mind looking at my project: https://github.com/E-Wagner/fellow I’ve been working many hours on this but it broke unexpectedly…

0reactions
larissa-ncommented, Jan 31, 2022

It might also be a <Router> wrapper component (if you migrated from an older version of react-static) like here.

Or if you have React.Suspense & React.lazy() inside of any page, it will also cause the same error (v.7.6.2).

It seems that this error can mean many different things. Is there any way that error messages could be more specific?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed exporting HTML for URL About (src\pages\About.js ...
This doesn't happen when running the site (npm run start). More odd, happens only when build the site, for some pages. The pages...
Read more >
Cannot read property 'href' of undefined? - Squarespace Forum
Site URL: https://www.uartsunion.org/ I am getting the "Cannot read property 'href' of undefined" error: Tech support says they can't help ...
Read more >
Gatsby 101 | Note of Thi - dinhanhthi.com
When React sees an element representing a user-defined component, it passes JSX attributes to this component as a single object. We call this...
Read more >
cannot read properties of undefined (reading 'href') - You.com
The "Cannot read properties of undefined" error occurs for multiple reasons: Accessing a property on a variable that stores an undefined value. Accessing...
Read more >
@netlify/esbuild-darwin-arm64 | Yarn - Package Manager
The macOS ARM 64-bit binary for esbuild, a JavaScript bundler. ... Fix code generation for export default and /* @__PURE__ */ call (#2203)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found