You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[http://not able to extract the issue](http://not able to extract the issue)
Steps to reproduce
I have a express app that calls nuxt.renderRoute for speicfic routes. Somehow, I wasn't able to track it down, I get the following error for logged in users:
Error: Cannot stringify arbitrary non-POJOs
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 44:31
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in devalue at line 53:5
/var/app/current/node_modules/nuxt/lib/core/renderer.js in Renderer.renderRoute at line 364:50
This issue first occured in nuxt 2, and the initial line that triggers it is the following one in renderRoute:
const serializedSession = window.__NUXT__=${devalue(context.nuxt)};
as far as I understand that means that in context.nuxt is a variable that has function in it? But why? Can we ignore the function? Or how can I get rid of it?
What is expected ?
Should render all routes, even if context.nuxt (what is it actually?), has a function in it
What is actually happening?
Error: Cannot stringify arbitrary non-POJOs
This bug report is available on Nuxt community (#c7909)
The text was updated successfully, but these errors were encountered:
Indeed I just found out that under some circumstances req.session.flash is set, by the "flash"-express middleware. https://github.com/expressjs/flash
This middleware puts a function into the session. I can imagine there are some other usecases like this too (even though I would agree that this session middleware is not a very nice one).
I suggest that serializedSessino should not crash, even when there is a functino in it. It should just strip all elements away which it can not serialize... (and put a warning to the console?).
Version
v2.1.0
Reproduction link
[http://not able to extract the issue](http://not able to extract the issue)
Steps to reproduce
I have a express app that calls nuxt.renderRoute for speicfic routes. Somehow, I wasn't able to track it down, I get the following error for logged in users:
Error: Cannot stringify arbitrary non-POJOs
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 44:31
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in null. at line 49:72
Array.forEach
/var/app/current/node_modules/devalue/dist/devalue.umd.js in walk at line 49:40
/var/app/current/node_modules/devalue/dist/devalue.umd.js in devalue at line 53:5
/var/app/current/node_modules/nuxt/lib/core/renderer.js in Renderer.renderRoute at line 364:50
This issue first occured in nuxt 2, and the initial line that triggers it is the following one in renderRoute:
const serializedSession =
window.__NUXT__=${devalue(context.nuxt)};
as far as I understand that means that in context.nuxt is a variable that has function in it? But why? Can we ignore the function? Or how can I get rid of it?
What is expected ?
Should render all routes, even if context.nuxt (what is it actually?), has a function in it
What is actually happening?
Error: Cannot stringify arbitrary non-POJOs
The text was updated successfully, but these errors were encountered: