Limenius/ReactBundle

TypeError: Cannot set property 'params' of undefined

Stafox opened this issue · 4 comments

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.

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.

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?

@nacmartin yes, you're right.

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