-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
TypeError: Cannot read property 'toLowerCase' of undefined #3019
Comments
did you also update |
Make sure you're importing things correctly. I had the same issue when i tried to import a component like this: |
@d3sandoval thanks, lets close this then 👍 |
I'm having a similar issue (I don't use zeit at all, just found this issue via Google). I doubt @d3sandoval's suggestion fixes the issue. I'm having a similar stack trace as OP and the issue seems to be rendering to static markup too early (??) in production mode. import {renderToStaticMarkup} from 'react-dom/server'
const expandedArrowHTML = renderToStaticMarkup(
<Icon icon='caret-down' />
) The above snippet works in dev, but fails with a similar stack trace as OP when built with I've worked around this by doing: import {renderToStaticMarkup} from 'react-dom/server'
import once from 'once'
const getExpandedArrowHTML = once(() => renderToStaticMarkup(
<Icon icon='caret-down' />
)) where |
This was happening to me with next.js and a shared lerna library on some shared code and the problem was the react component wasn't defined with a const, instead it looked like this:
However the 'Thing' component needed to be a const. I'm assuming the variable was disappearing from scope and thus the error. Not sure if it is the same issue you might be having, but I hope to help some one.
|
@naquiuddin How did you finally resolve the same? I'm having the exact same problem and trying to work with the solution that's provided here: react-static/react-static#209 (comment) didn't really help me! |
@ayushgupta0610 stateless functions are allowed, it's probably something related to the way you're transpiling the imports, are you using typescript or some special babel config ? |
Sorry, I didn't respond earlier. Basically this is occurring when we close the tag with two angle brackets at the end ( >> ) in JSX code. When I fixed this with single angle bracket ( > ). This issue isn't showing up. Hope this helps. For example if you do |
i had some comment on my component that produced the problem <meta name="description" content="Virtual Seating"/> {/* <script src="//aframe.io/releases/0.7.1/aframe.min.js"/> */}
<script src="/static/js/aframe-master.min.js" async></script> pay attention to comments so! |
^ Exactly what happened to me. Check your comments. |
Everything was working fine until I did npm update, I see this problem.
the only change I see that could break is
"next": "^4.0.0-beta.1",
changing to"next": "^4.0.0-beta.2"
. I reverted next back to"next": "^4.0.0-beta.1",
but the isssue persists.I run Next using
node server.js
using next-routes.Server side code is:
The issue is referenced here as well. Not sure whether it is React 16 or NEXT.js
amcharts/amcharts3-react#53
Any idea what could be the issue?
Your Environment
The text was updated successfully, but these errors were encountered: