-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@wordpress/scripts version 20.0.1 doesn't compile files #38357
Comments
Related/duplicate: #38343 |
@aurooba, thank you for the report. It looks like you are right. It was a risky change in terms of backward compatibility and I would appreciate your help to improve handling for existing projects. Do you have your plugin publicly available so I could give it for a spin? Alternatively, I’d like to confirm how do you run the build. Is it |
@gziolo yes, the plugin is here: https://github.com/createwithrani/superlist However, I want to note that I tested the new version on a totally empty brand new plugin, scaffolding test blocks with I've tested/tried both the |
Thank you so much. I'm giving it a round of testing 👍🏻 |
I published a new version v20.0.2 of Some more details from my investigation on the plugin. I noticed that the Superlist plugin provides its own webpack config file: https://github.com/createwithrani/superlist/blob/main/webpack.config.js If you remove it, it will now fall back to the entry point The plan is to use relative paths to the script from In this case, there are 3 options:
|
@gziolo I added the |
I've tested this with the new plugin. I think the key part of the instruction you gave me is this for using the
This piece of information should absolutely live in the documentation on NPM itself and in the developer docs. The phrasing over there is simply not clear enough, and I'm pretty sure this is the mistake I made initially when testing v20.0.1. I'm going to propose a PR (#38379) to reflect this phrasing in the documentation. Thanks @gziolo! |
Provides a clearer explanation based on conversation in WordPress#38357 on how the scanning of `block.json` works and what the paths of the script/style files should be.
Thank you! I appreciate all the clarifications proposed. I will review tomorrow 👌 |
Provides a clearer explanation based on conversation in #38357 on how the scanning of `block.json` works and what the paths of the script/style files should be.
I am sorry for saying this but, now i can not create any WordPress block by @wordpress/create-block package since that I updated the npm to latest version. Unfortunately, i can not rearrange or add a line of code to my old blocks. My terminal is full of errors. I think this is shame for "@wordpress/scripts create-block" developers. This is terrible. Please help me with suggesting any other package for creating WordPress block with block.json usage. |
This is my terminal: PS C:\xampp2\htdocs\benimsitem\wp-content\plugins> npx @wordpress/create-block stcnnt-ps Creating a new WordPress plugin in "stcnnt-ps" folder. Creating a "block.json" file. Creating a "package.json" file. Installing Formatting JavaScript files. Compiling block. Error: Command failed with exit code 2: npm run build
shortMessage: 'Command failed with exit code 2: npm run build', Node.js v17.4.0
[webpack-cli] HookWebpackError: error:0308010C:digital envelope routines::unsupported |
I'm getting the same as @muzafferkaya-gokalpay using this tool and trying to create a new project. |
@muzafferkaya-gokalpay and @codente this could be because you are on node 17+, there have been some webpack issues that aren't yet fully resolved, maybe try downgrading node to v16? |
Thank you. That resolved it for me. |
Description
It could be that I'm doing something wrong, but since updating wordpress/scripts to
20.0.1
, all it does (when there are multiple blocks) is copy theblock.json
files for each block into thebuild
folder. And doesn't actually compile anything. I've had to downgrade to19.2.4
for compiling of any kind to work. I've been following #25188, and wondering if the two patches introduced earlier this month caused some kind of issue.Step-by-step reproduction instructions
@wordpress/scripts
with:npm install @wordpress/scripts --save-dev
npx wp-scripts start
(ornpm start
if you added the scripts to yourpackage.json
)block.json
files duplicated.Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: