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

Bug: Can not edit a post with 0.6 #778

Closed
DirtyF opened this issue Nov 6, 2017 · 21 comments
Closed

Bug: Can not edit a post with 0.6 #778

DirtyF opened this issue Nov 6, 2017 · 21 comments
Milestone

Comments

@DirtyF
Copy link
Contributor

DirtyF commented Nov 6, 2017

- Do you want to request a feature or report a bug?

🐛 Report a bug.

- What is the current behavior?

Can not edit any of the posts in the CMS since latest version.
macOS High Sierra / latest Firefox 🦊

I thought it was related to CSP rules but it's currently report-only mode

- If the current behavior is a bug, please provide the steps to reproduce.

Click on a post on the dashboard. Get a blank screen, open the console and see this message:

Checking for MetaData files

cms.js:70:111260
 2017-10-03-interview-hugo-lead-developer does not have metadata
cms.js:70:111583
Invariant Violation: Minified React error #40; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=40 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Stack trace:
r@https://unpkg.com/netlify-cms/dist/cms.js:163:58452
unmountComponentAtNode@https://unpkg.com/netlify-cms/dist/cms.js:163:163295
value@https://unpkg.com/netlify-cms/dist/cms.js:754:121371
l@https://unpkg.com/netlify-cms/dist/cms.js:163:83842
i@https://unpkg.com/netlify-cms/dist/cms.js:163:82924
a@https://unpkg.com/netlify-cms/dist/cms.js:163:83364
commitDeletion@https://unpkg.com/netlify-cms/dist/cms.js:163:85136
n@https://unpkg.com/netlify-cms/dist/cms.js:163:89650
u@https://unpkg.com/netlify-cms/dist/cms.js:163:91520
c@https://unpkg.com/netlify-cms/dist/cms.js:163:91963
m@https://unpkg.com/netlify-cms/dist/cms.js:163:93985
h@https://unpkg.com/netlify-cms/dist/cms.js:163:93494
enqueueSetState@https://unpkg.com/netlify-cms/dist/cms.js:163:74761
o.prototype.setState@https://unpkg.com/netlify-cms/dist/cms.js:163:50770
u/</r</l.prototype.handleChange@https://unpkg.com/netlify-cms/dist/cms.js:163:173824
c@https://unpkg.com/netlify-cms/dist/cms.js:70:67221
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:70:91361
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:163:198161
dispatch@https://unpkg.com/netlify-cms/dist/cms.js:163:179939
_/<@https://unpkg.com/netlify-cms/dist/cms.js:29:20602
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:163:198154
dispatch@https://unpkg.com/netlify-cms/dist/cms.js:163:179939
v/</<@https://unpkg.com/netlify-cms/dist/cms.js:29:106426
Async*v/<@https://unpkg.com/netlify-cms/dist/cms.js:29:106291
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:163:198154
n/a.loadEntry@https://unpkg.com/netlify-cms/dist/cms.js:754:130576
value@https://unpkg.com/netlify-cms/dist/cms.js:181:162512
commitLifeCycles@https://unpkg.com/netlify-cms/dist/cms.js:163:85747
n@https://unpkg.com/netlify-cms/dist/cms.js:163:89854
u@https://unpkg.com/netlify-cms/dist/cms.js:163:91520
c@https://unpkg.com/netlify-cms/dist/cms.js:163:91963
batchedUpdates@https://unpkg.com/netlify-cms/dist/cms.js:163:94825
T@https://unpkg.com/netlify-cms/dist/cms.js:163:62076
_@https://unpkg.com/netlify-cms/dist/cms.js:163:62012
batchedUpdates@https://unpkg.com/netlify-cms/dist/cms.js:163:109600
dispatchEvent@https://unpkg.com/netlify-cms/dist/cms.js:163:110449
EventListener.handleEvent*listen@https://unpkg.com/netlify-cms/dist/cms.js:163:164348
trapBubbledEvent@https://unpkg.com/netlify-cms/dist/cms.js:163:109999
listenTo@https://unpkg.com/netlify-cms/dist/cms.js:163:114681
q@https://unpkg.com/netlify-cms/dist/cms.js:163:65928
setInitialProperties@https://unpkg.com/netlify-cms/dist/cms.js:163:125942
finalizeInitialChildren@https://unpkg.com/netlify-cms/dist/cms.js:163:161021
completeWork@https://unpkg.com/netlify-cms/dist/cms.js:163:81797
o@https://unpkg.com/netlify-cms/dist/cms.js:163:90395
i@https://unpkg.com/netlify-cms/dist/cms.js:163:91011
u@https://unpkg.com/netlify-cms/dist/cms.js:163:91488
c@https://unpkg.com/netlify-cms/dist/cms.js:163:91963
m@https://unpkg.com/netlify-cms/dist/cms.js:163:93985
h@https://unpkg.com/netlify-cms/dist/cms.js:163:93494
enqueueSetState@https://unpkg.com/netlify-cms/dist/cms.js:163:74761
o.prototype.setState@https://unpkg.com/netlify-cms/dist/cms.js:163:50770
u/</r</l.prototype.handleChange@https://unpkg.com/netlify-cms/dist/cms.js:163:173824
c@https://unpkg.com/netlify-cms/dist/cms.js:70:67221
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:70:91361
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:163:198161
dispatch@https://unpkg.com/netlify-cms/dist/cms.js:163:179939
u/<@https://unpkg.com/netlify-cms/dist/cms.js:29:36363
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:163:198154
dispatch@https://unpkg.com/netlify-cms/dist/cms.js:163:179939
c/</<@https://unpkg.com/netlify-cms/dist/cms.js:29:36652
promise callback*c/<@https://unpkg.com/netlify-cms/dist/cms.js:29:36450
r/</<@https://unpkg.com/netlify-cms/dist/cms.js:163:198154
value@https://unpkg.com/netlify-cms/dist/cms.js:181:21897
commitLifeCycles@https://unpkg.com/netlify-cms/dist/cms.js:163:85747
n@https://unpkg.com/netlify-cms/dist/cms.js:163:89854
u@https://unpkg.com/netlify-cms/dist/cms.js:163:91520
c@https://unpkg.com/netlify-cms/dist/cms.js:163:91963
m@https://unpkg.com/netlify-cms/dist/cms.js:163:93985
h@https://unpkg.com/netlify-cms/dist/cms.js:163:93494
updateContainer@https://unpkg.com/netlify-cms/dist/cms.js:163:159930
pt/<@https://unpkg.com/netlify-cms/dist/cms.js:163:101189
unbatchedUpdates@https://unpkg.com/netlify-cms/dist/cms.js:163:94899
pt@https://unpkg.com/netlify-cms/dist/cms.js:163:101158
render@https://unpkg.com/netlify-cms/dist/cms.js:163:163122
@https://unpkg.com/netlify-cms/dist/cms.js:163:47636
t@https://unpkg.com/netlify-cms/dist/cms.js:1:341
@https://unpkg.com/netlify-cms/dist/cms.js:1:703
@https://unpkg.com/netlify-cms/dist/cms.js:1:247
@https://unpkg.com/netlify-cms/dist/cms.js:1:219
@https://unpkg.com/netlify-cms/dist/cms.js:1:2
cms.js:163:93262
Error: Minified React error #40; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=40 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
cms.js:163:58452

- What is the expected behavior?

Being able to edit the post.

- Please mention your CMS, node.js, and operating system version.

Latest version : 0.6

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

@DirtyF we haven't seen other reports of this, can you provide steps to reproduce?

@erquhart erquhart added this to the 1.0.0 milestone Nov 6, 2017
@DirtyF
Copy link
Contributor Author

DirtyF commented Nov 6, 2017

This only happens with latest Firefox, can not reproduce the problem with latest Google Chrome.

netlify-cms-firefox

Of course the file contains metadata, but this error keep showing in the console :

 Checking for MetaData files cms.js:70:111260

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

Firefox stable?

@DirtyF
Copy link
Contributor Author

DirtyF commented Nov 6, 2017

Tested with Firefox 56.0.2 (stable) and Firefox Nightly, both display the same error.

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

Boom, got it. Not present in 56.0.1, but it's there in 56.0.2. Investigating.

@tech4him1
Copy link
Contributor

With that "does not have metadata" error, is this only happening in Editorial Workflow?

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

That's actually just a console log, not an error. Debugging in FF is pretty rough, console logging my way through it now.

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

Seems to be generating from this guy:

https://github.com/ryanseddon/react-frame-component

@Benaiah
Copy link
Contributor

Benaiah commented Nov 6, 2017

@erquhart that's also what I'm seeing. My current repro uses the following steps:

  • Use editorial workflow and the GitHub backend
  • Edit a post
  • Go to editorial workflow screen and publish the post
  • Go to the posts page and try to view the post you just published
  • error shows up

Gonna test with the simple workflow to see if that affects it (I suspect the error isn't dependent on workflow, though).

EDIT: error does not show up in the simple workflow with the same set of steps (minus the EW-specific stuff)

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

I'm seeing it just opening any entry from the collection page on an EW implementation.

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

Playing with a local version of react-frame-component now, although it's telling that this bug doesn't surface if you load the entry directly by url.

@tech4him1
Copy link
Contributor

tech4him1 commented Nov 6, 2017

Weird, I saw that error before when I was upgrading React 16, but then I couldn't repro it again in Chrome, so I thought it was fixed.

it's telling that this bug doesn't surface if you load the entry directly by url.

@erquhart That was the case I was seeing it in as well.

@Benaiah
Copy link
Contributor

Benaiah commented Nov 6, 2017

I'd definitely like an error boundary around the preview frame - preview errors shouldn't break the application entirely, especially since end users can insert their own code there.

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

Submitting a PR to react-frame-component. If we can't get a super quick release from them we'll use a temporary fork to bridge the gap tomorrow.

@DirtyF for now, the best workaround is either use a different browser or refresh the page after the entry fails to load.

@tech4him1
Copy link
Contributor

@Benaiah The preview frame is technically an iframe, so I don't any errors would actually escape it or interfere with React. Or am I mistaken there?

@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2017

We interact with the preview via context, so it is possible.

@erquhart
Copy link
Contributor

erquhart commented Nov 7, 2017

@DirtyF update: going to do what @Benaiah suggested and build our first Error Boundary around the preview iframe, something we need to start doing across the app anyway. PR forthcoming.

@DirtyF
Copy link
Contributor Author

DirtyF commented Nov 7, 2017

@erquhart 👌 Thanks for the update. Looking forward to use v1.0 with Firefox Quantum 🦊 🏁 🎊

@erquhart
Copy link
Contributor

erquhart commented Nov 7, 2017

Quantum looks awesome, did not know about that!

In other news, the issue is no longer occurring when the error boundary is in place, which confirms my suspicion that it's a race condition. Still, not considering this closed until the lib fix is released, but this will help. Even if the preview throws, the rest of the page is still active, and you can edit and save sans preview (or just refresh).

Releasing soon.

@DirtyF
Copy link
Contributor Author

DirtyF commented Nov 7, 2017

You rock. 🎸

@erquhart
Copy link
Contributor

erquhart commented Dec 9, 2017

Update: fix merged a while back, just waiting on release. Going to go ahead and close since this is effectively fixed and we're just waiting for a release that will be automatically pulled in to cms deps.

@erquhart erquhart closed this as completed Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants