Git Product home page Git Product logo

Comments (9)

bobbingwide avatar bobbingwide commented on June 22, 2024

This information may help someone attempting to debug their own server side rendered block.
The following message is may be shown when you attempt to create a block that is server side rendered but haven't written the server side logic.

Error loading block: No route was found matching the URL and request method 

This was the case when I first developed the geshi block. I'd only written some JS; none of the PHP.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

If the server side rendering doesn't return anything then you'll get a spinner.
s b_wordpress_wp-admin_post php_post 952 action edit

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

If you see This block has encountered an error and cannot be previewed then you should look at the JavaScript console. You might find something like this... ReferenceError: SelectControl is not defined.
This indicates that you need to add an import statement.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

Error loading block: Invalid parameter(s): attributes is produced when one or more of the attributes passed to the server is not recognised.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

Here's what I have so far.
image

I can make it hide the input field when the block is not selected, but can't position the input field above the server rendered output nor prevent the server rendering while I'm typing into the field.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

Primary purpose is to avoid problems with unwanted p and br tags created by Gutenberg when attempting to write a post using the Block editor which contains the [bw_geshi] shortcode.

The reason this happens is because the shortcode block is rendered using

function render_block_core_shortcode( $attributes, $content ) {
	return wpautop( $content );
}

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

It appears I need to change the oik_geshi() code to accept a default value of "none" for the lang. The server side rendering logic doesn't always want to pass "lang=none" from the SelectControl.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

The logic for this block has been copied to https://github.com/bobbingwide/oik-css which is being converted to a standalone plugin for two blocks oik-css/css and oik-css/geshi.
Over time the solution in oik-blocks will be deprecated.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 22, 2024

The GeSHi block is now delivered by the oik-css plugin

from oik-blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.