JavaScript for WordPress Forums Gutenberg Development Errors in new gutenberg-course plugin

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #48987
    charlesloehle
    Participant

    After installation of zgordon/gutenberg-course I am getting this error in all the blocks files when i npm run dev:
    ERROR in ./blocks/01-static/index.js
    Module build failed: SyntaxError: C:/Users/New Owner/Documents/Websites/gutenberg-practice.dev.cc/wp-content/plugins/gutenberg-course-master/blocks/01-static/index.js: Unexpected token

    jspforwp-example-blocks on my other machine works fine though

    Thanks!
    Charles

    #49011
    Zac Gordon
    Keymaster

    Hey Charles, it may not be this simple, but did you run npm install beforehand?

    #49180
    charlesloehle
    Participant

    Hi Zach,
    Yes I ran npm install. I also did with a fresh download of the plugin. Same error.

    ERROR in ./blocks/01-static/index.js
    Module build failed: SyntaxError: C:/Users/New Owner/Local Sites/gutenberg-practice/app/public/wp-content/plugins/gutenberg-course-master/blocks/01-static/index.js: Unexpected token (35:12)

    It points to the less than symbol in the return before div className=

    #49203
    Zac Gordon
    Keymaster

    Okay, was worried it might not be that simple. So you have everything loaded and updated. And you have the latest version of the plugin and WordPres? And it works in one environment but not the other. I tried to duplicate the problem but can’t.

    So, I’m wondering if it is a hidden character or something messing things up. What happens if you delete the code in that file and type it from scratch as it is in the example code but not copy and pasting?

    #49343
    charlesloehle
    Participant

    All my plugins and wordpress are up to date.

    Let me clarify that the old version of your plugin, jspforwp-example-blocks, works but the new plugin of yours, gutenberg-course, does not.

    #49395
    Zac Gordon
    Keymaster

    Okay, I’m seeing what you’re seeing now.. exploring solution..

    #49397
    Zac Gordon
    Keymaster

    Okay, it looks like the .babelrc file was not there so it was not understanding JSX.

    Should be all fixed now 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.