February 23, 2018 at 11:18 pm #42203
I know I am missing something very simple here, but I just can’t find it. I am following along with Section 4, but stopped at 4.03. I am using Atom for my code editor, and working on a local install of Vanilla Press with Desktop Server. I downloaded and installed the plugin just like any other in WP.
I have verified that Line 21 of jsforwp-blocks/blocks/register-block-type/00-demo/index.js does read
title: __( 'registerBlockType - Example' ),but the title of the block in my Vanilla Press editor still says Demo. The install of WordPress and Gutenberg are all current.
Initially, I did not execute
npm installbecause I am running Atom with the GUI version of GitHub, which does the watching. However, I thought this may be the problem, so I installed a terminal and ran it and
npm run devand had some errors but tried again. Still no luck.
Yes, I did make sure all the files were saved. I even went into the Windows Explorer and opened the file in a completely different editor. This is driving me crazy! What am I missing?February 25, 2018 at 8:10 am #42243
Okay, this sounds like a problem getting setup with the build tools:
– Make sure you’re working with the plugin inside your /wp-content/plugins folder
– You will want to run
npm installin the main folder with the package.json file in it
– If you want to edit the files, the best thing to do is run
npm run devfirst (npm run build is more meant for when you are done and want to run the build one final time)
If you have errors from running any of these commands, please post them up and we’ll get you up and running.February 26, 2018 at 2:44 pm #42277
Okay, I will try those things. One question: I have this installed properly just like any other plugin. Why can I not just go into the installed files, make the changes and have them show up? Just as if I had written the plugin myself?February 26, 2018 at 4:03 pm #42283
It is an extra step, but does provide a lot of benefits that make it worth it 🙂
Hope that helps! Let me know how the config process goes!March 6, 2018 at 9:50 pm #42736
Almost there. Now when I run
npm run devI get the error ‘webpack’ is not recognized as an internal or external command, operable program or batch file. I tried a few solutions from StackOverflow, but no luck.March 7, 2018 at 4:42 pm #42761
Not sure what I had wrong, but I had an IRL developer friend help me. All is good. Now, on to development!March 8, 2018 at 11:02 pm #42827
Not so fixed as I thought. I wanted to try again from scratch and I am still getting the same error: Cannot find module ‘webpack’.March 8, 2018 at 11:25 pm #42830
Let’s try this to troubleshoot:
1. Download the repo – https://github.com/zgordon/gutenberg-course/archive/master.zip
2. Open it in the command line
3. Run npm install
4. Run npm run dev
5. Open a JS file in the /blocks/examples and make a change to it
6. The command line should update
You don’t have to install this as a plugin and test it, just want to see exactly where the problem is happening for you.March 8, 2018 at 11:33 pm #42832
Actually, I think the problem is the terminal package I am using in Atom. It seems there is a known issue with the terminal package platformio-ide-terminal in Atom. Evidently, it does not install npm and node correctly. I just opened good old cmd in windows, did the install and the watch, and now everything is working.
- You must be logged in to reply to this topic.