I created a Gutenberg block plugin on one computer in a local site using create-guten-block. It works fine.
I'm trying to copy/move it to a different Wordpress install on another computer, and no matter the method I try I always wind up with
This block has encountered an error and cannot be previewed.
I created a Git repo out of the plugin on computer 1 and created a repo on Github and pushed it.
I cloned the repo into the
plugins directory on computer 2, ran
npm i, even tried
npm run build and
npm start (which all ran without a hitch), but the block does not load in the post editor. It just loads with the error above.
I've even tried going from computer 2 to computer 1 with a different block, same thing.
Is there no way to develop blocks on 2 different machines via a git repo, which is how I develop everything else (such as themes)? What am I missing here?
edit: the react error in the console is
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Note this block works perfectly on computer 1.