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: Cannot read property 'toLowerCase' of undefined at a.renderDOM

See original GitHub issue
=> Exporting Routes...
TypeError: Cannot read property 'toLowerCase' of undefined
    at a.renderDOM
(/home/vladimir/Workspace/site/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:391)
    at a.render
(/home/vladimir/Workspace/site/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:228)
    at a.read
(/home/vladimir/Workspace/site/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:35:250)
    at renderToString
(/home/vladimir/Workspace/site/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:6)
    at renderStringAndHead
(/home/vladimir/Workspace/site/node_modules/react-static/lib/static.js:337:68)
    at Object.renderToHtml
(/home/vladimir/Workspace/site/node_modules/react-static/lib/utils.js:189:14)
    at _callee3$
(/home/vladimir/Workspace/site/node_modules/react-static/lib/static.js:360:39)
    at tryCatch
(/home/vladimir/Workspace/site/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke]
(/home/vladimir/Workspace/site/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next]
(/home/vladimir/Workspace/site/node_modules/regenerator-runtime/runtime.js:114:21)
    at step
(/home/vladimir/Workspace/site/node_modules/react-static/lib/static.js:120:191)
    at
/home/vladimir/Workspace/site/node_modules/react-static/lib/static.js:120:437
    at new Promise (<anonymous>)
    at
/home/vladimir/Workspace/site/node_modules/react-static/lib/static.js:120:99
    at
/home/vladimir/Workspace/site/node_modules/react-static/lib/static.js:474:30
    at Array.map (<anonymous>)
error Command failed with exit code 1.

In the first argument of renderDOM is passed this kind object:

{ '$$typeof': Symbol(react.element),
  type: undefined,
  key: null,
  ref: null,
  props: {},
  _owner: null }

example that reproduces the issue https://github.com/trebushuk/test-react-project

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tannerlinsleycommented, Dec 26, 2017

It doesn’t look like you are exporting your app from that file. It needs to export the component for your static rendering to work. On Mon, Dec 25, 2017 at 10:27 PM Vladimir Trebushuk < notifications@github.com> wrote:

import React from 'react’import ReactDOM from 'react-dom’import { AppContainer } from ‘react-hot-loader’ // Your top level componentimport App from ‘./App’ // Export your top level component as JSX (for static rendering) // Render your appif (typeof document !== ‘undefined’) { const render = Comp => { const renderMethod = !!module.hot ? ReactDOM.render : ReactDOM.hydrate renderMethod( <AppContainer> <Comp /> </AppContainer>, document.getElementById(‘root’), ) }

// Render! render(App)

// Hot Module Replacement if (module.hot) { module.hot.accept(‘./App’, () => { render(require(‘./App’).default) }) } }

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/nozzle/react-static/issues/267#issuecomment-353919901, or mute the thread https://github.com/notifications/unsubscribe-auth/AFUmCbAUm4bW0T7G-kqsDKImBlxXLp5_ks5tEIPUgaJpZM4RMWhy .

0reactions
tannerlinsleycommented, Jan 16, 2018

Closing in favor of @D1no’s proposed link to the solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'toLowerCase' of ...
toLowerCase() is undefined? What debugging have you tried already? It seems either paletteName isn't a property on the elements in the palettes ...
Read more >
Cannot Read Property 'Tolowercase' Of Undefined In Reactjs
1. Uncaught TypeError: Cannot read property of undefined JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible...
Read more >
Cannot read property 'toLowerCase' of undefined
hello i am try to check seo in my post data butits not open tabs after check in console it have error on...
Read more >
MDB React in Gatsby.js - Material Design for Bootstrap
Did you ever get this problem solved? I'm getting the same error (WebpackError: Cannot read property 'toLowerCase' of undefined) in my Gatsby.js project...
Read more >
react - trial and stderr
Starting a new NextJS project, I was getting errors like TypeError: Cannot read property 'toLowerCase' of undefined at ReactDOMServerRenderer.renderDOM ...
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