Warning: include(.../format-api/build/index.asset.php): failed to open stream: No such file or directory in ...format-api/index.php on line 20
mipon opened this issue · comments
The current trunk
branch produces the following warning.
Warning: include(wp-content/plugins/gutenberg-examples/format-api/build/index.asset.php): failed to open stream: No such file or directory in .../wp-content/plugins/gutenberg-examples/format-api/index.php on line 20
It appears the build files are missing.
I believe this has been addressed but can you confirm that this is still an issue for you?
There has been no movement on this and I cannot reproduce locally. Closing for now but feel free to re-open if the issue persists.
@tiennguyenvan did you run npm install
first?
@KevinBatdorf I did and here is the screenshot after running:
The dependencies need to be updated. The lock file looks to be out of sync as well.
You have two options for now (only do one):
Option 1:
Change line 23 in package.json to "prettier": "npm:wp-prettier@^2.6.2"
then run npm i
again
Option 2:
Don't change anything, but run npm i --force
(In general, using --force
is not something you should want to rely on, so think of this as a temporary hack)
Thank you very much. Both options worked well for the npm install. But here are the errors for "npm run build:all"
I also manually created a plugin following the structure of this plugin but my block does not show in the block list of the editor.
This is the reason why I love to see the example plugin run in real to start learning from it.
Thanks a lot.
Try using node 16.18.0 to resolve the error. I'm not sure as I've never seen that error before, but my guess is you're on a newer version of Node.
I also manually created a plugin following the structure of this plugin but my block does not show in the block list of the editor.
Nothing will show until you get the bundler to build the package successfully without errors.
@KevinBatdorf Wow. You are correct. After updating the Node to the latest version, I could build the package properly. Thank you very much. You saved my day. Merry Christmas.
@KevinBatdorf This question could be stupid: if I am trying to create a similar plugin that provides extra blocks so I just clone this package, replace the name, modify the code and build then it will work the same, is that right?
I am really new to Node.
Thank you very much, Kevin.
The question is fine. You're better off opening a new issue though to discuss that. I'm also not the best person to answer it.
I think you would want to use the create-block package and then go from there. I'm not sure how up to date the documentation is though, so you may need to just keep at it and do a lot of Google searching.
@ryanwelcher has a bunch of YouTube videos as well you can check out: https://www.youtube.com/c/RyanWelcherCodes
@KevinBatdorf Thank you, Kevin. I subscribed to @ryanwelcher's channel. I will create other tickets if needed. Nice to meet you here, Kevin.