Automattic / crowdsignal-forms

Gutenberg blocks for Crowdsignal
GNU General Public License v2.0
13 stars 9 forks source link

disable PostPreviewButton because it is crashing the block on re-renders #274

Closed jgcaruso closed 5 months ago

jgcaruso commented 6 months ago

This PR removes the "Preview" button on the NPS block because its presense is causing the block to blow up in the editor.

Tracking in https://github.com/Automattic/crowdsignal-forms/issues/273

Testing

  1. First test in master
  2. Add an NPS block to a post
  3. Publish the post
  4. refresh the editor
  5. The block will show a "This block has encountered an error and cannot be previewed" error
  6. Apply this branch
  7. run make client
  8. refresh the editor
  9. The block will render
jgcaruso commented 6 months ago

@gikaragia

Also couldn't figure out if it is possible to enable source mapping to see where the issue is coming from, although I enabled define( 'SCRIPT_DEBUG', true ).

Yeah I ran into the same issue too. Not sure why the react debug scripts weren't being served with that constant set.

For some reason can't log anything in the console. Are console.logs removed during the build step?

I'm not sure about this.

Seems like something is messed up in the order componentActions are mapped in EditorNotice but couldn't figure it out.

Yeah it seemed like something in Gutenberg itself, not necessarily something the block was doing wrong. If we really want to get to the bottom of it, we may need to setup a WordPress/Gutenberg dev environment?