JavaScript for WordPress › Forums › Gutenberg Development › Title Setting Not Changing
- This topic has 8 replies, 2 voices, and was last updated 6 years, 10 months ago by Sally.
-
AuthorPosts
-
February 23, 2018 at 11:18 pm #42203SallyParticipant
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 install
because 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 andnpm run dev
and 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 #42243Zac GordonKeymasterHi Sally!
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 runnpm install
in the main folder with the package.json file in it
– If you want to edit the files, the best thing to do is runnpm run dev
first (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 #42277SallyParticipantOkay, 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 #42283Zac GordonKeymasterHi Sally!
The reason is that the plugin pulls in a compiled version of all the other JavaScript files. This is so that we can use things like imports and JSX and other JavaScript features that might not be supported in browsers.
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 #42736SallyParticipantAlmost there. Now when I run
npm run dev
I 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 #42761SallyParticipantNot 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 #42827SallyParticipantNot 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 #42830Zac GordonKeymasterHi Sally,
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 updateYou 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 #42832SallyParticipantActually, 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.
-
AuthorPosts
- You must be logged in to reply to this topic.