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

Cannot create property 'i18nStamp' on boolean 'true' #9

Closed
ljosberinn opened this issue Jan 3, 2020 · 1 comment · Fixed by #10
Closed

Cannot create property 'i18nStamp' on boolean 'true' #9

ljosberinn opened this issue Jan 3, 2020 · 1 comment · Fixed by #10

Comments

@ljosberinn
Copy link
Contributor

Noticed this when Netlify Webhooks send a notification to a Discord channel. Discord will visit the site to fetch graph metadata, using Headless Chrome.

This leads to requesting the translation from the backend, which (sometimes) fails; that's something else I'm looking into. XHR-Backend returns true as data which leads to chained-backend triggering the save-callback because JS thinks Object.keys(true).length > -1 === true is fine.

So probably,

if (data && Object.keys(data).length > -1) {

should be

if(data && data !== true && Object.keys(data).length > -1) {

Happy to create a PR if this is fine.

@jamuhl
Copy link
Member

jamuhl commented Jan 3, 2020

Arghh...right....if (!err && data && Object.keys(data).length > -1) { should do the trick...if you like I would happy accept a PR...else I will try to add this sometime next week

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

Successfully merging a pull request may close this issue.

2 participants