Skip to content
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 set property 'params' of undefined #15

Closed
Stafox opened this issue Oct 18, 2016 · 4 comments
Closed

TypeError: Cannot set property 'params' of undefined #15

Stafox opened this issue Oct 18, 2016 · 4 comments

Comments

@Stafox
Copy link

Stafox commented Oct 18, 2016

Hello,

I'm new in react. I made an application (in analogy of your sandbox example) with server rendering. In prod environment it works as expected.
But in dev (app_dev.php) I got error.

[SERVER] stack: TypeError: Cannot set property 'params' of undefined
    at exports.default (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:24201:24)
    at createReactElement (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:21836:13)
    at serverRenderReactComponent (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:24030:72)
    at Object.serverRenderReactComponent (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:277:54)
    at eval (eval at <anonymous> (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:57497:8), <anonymous>:4:23)
    at eval (eval at <anonymous> (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:57497:8), <anonymous>:11:3)
    at /tmp/nacmartin_phpexecjs58069148960831.10409992.js:57497:8
    at /tmp/nacmartin_phpexecjs58069148960831.10409992.js:57503:14
    at console.history (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:1:92)
    at Object.<anonymous> (/tmp/nacmartin_phpexecjs58069148960831.10409992.js:1:110)

Also I see several warnings in console after error:

Warning: render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.
Warning: [react-router] Location "/app_dev.php" did not match any routes

Maybe anybody can tell in which direction I should digg to fix error? Thanks.

@Stafox
Copy link
Author

Stafox commented Oct 19, 2016

So, I found the issue. The location was /app_dev.php. But route to the home page in dev env is /app_dev.php**/**. Maybe it helps somebody.

@nacmartin
Copy link
Member

Thanks, Stafox. I am not sure I understood this. Do you mean that are some links pointing to /app_dev.php instead of /app_dev.php/ in the client side code?

@Stafox
Copy link
Author

Stafox commented Nov 22, 2016

@nacmartin yes, you're right.

@nacmartin
Copy link
Member

This should be fixed now in the sandbox. Thanks for the report.

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

2 participants