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

WARN Cannot stringify a function #4424

Closed
lucpotage opened this Issue Nov 26, 2018 — with CMTY · 4 comments

Comments

Projects
None yet
3 participants

lucpotage commented Nov 26, 2018 — with CMTY

Version

v2.3.2

Reproduction link

https://nuxtjs.org

Steps to reproduce

Refresh a page.

What is expected ?

No warn.

What is actually happening?

A warn in the console: Cannot stringify a function

Additional comments?

I used the latest version of Nuxt with some modules (i18n, style resources, analytics). I have got the issue since version 2. How to better debug this kind of warning to detect which part of Nuxt is causing it?

This bug report is available on Nuxt community (#c8209)
@aldarund

This comment has been minimized.

Collaborator

aldarund commented Nov 27, 2018

It should output function name
https://github.com/nuxt-community/devalue/blob/master/src/index.ts#L27
Your store/asyncData object shouldnt contain functions, symbols and other non serializable datas

@lucpotage

This comment has been minimized.

lucpotage commented Nov 27, 2018

Thank you for leading me to the right direction!

I tested few things and realized the problem was linked to the nuxt-i18n module. The documentation suggests to return an object or a function and in my case, returning a function outputs this warning. I changed all my locale files and now export objects.

@lucpotage lucpotage closed this Nov 28, 2018

@lucpotage

This comment has been minimized.

lucpotage commented Nov 28, 2018

This may interest you @manniL.

@manniL

This comment has been minimized.

Member

manniL commented Nov 28, 2018

@lucpotage thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment