Description
When trying to generate a new solution, the cli fails with a "componentName is not defined" error.
Steps to reproduce
- run
fnm i 22.20.0
- run
npm i -g @microsoft/spfx-cli
- run
spfx create --template-name webpart-react --library-name my-spfx-library --component-name "Hello World"
Expected behavior
Expectation is that solution is created in the current folder
Actual behavior
Received the following error message
Error creating SPFx component: config/config.json:5
3| "version": "2.0",
4| "bundles": {
>> 5| "<%= componentName.hyphen %>-web-part": {
6| "components": [
7| {
8| "entrypoint": "./lib/webparts/<%= componentName.camel %>WebPart/<%= componentName.pascal %>WebPart.js",
componentName is not defined
Error: config/config.json:5
3| "version": "2.0",
4| "bundles": {
>> 5| "<%= componentName.hyphen %>-web-part": {
6| "components": [
7| {
8| "entrypoint": "./lib/webparts/<%= componentName.camel %>WebPart/<%= componentName.pascal %>WebPart.js",
componentName is not defined
CLI version
0.1.0-pre.2 via npm ls -g (see below)
Node.js version
v22.20.0
Operating system
Windows
Template (if applicable)
all templates
Additional context
-
This was tested in PowerShell and WSL terminals. Same results in both.
-
I tested many (but not all) of the templates and received the same error each time.
-
Additionally: spfx --version gives the following error:
usage: spfx [-h] <command> ...
spfx: error: too few arguments
- Previous version has similar error for componentName, but I didn't get it reported in time.
Description
When trying to generate a new solution, the cli fails with a "componentName is not defined" error.
Steps to reproduce
fnm i 22.20.0npm i -g @microsoft/spfx-clispfx create --template-name webpart-react --library-name my-spfx-library --component-name "Hello World"Expected behavior
Expectation is that solution is created in the current folder
Actual behavior
Received the following error message
CLI version
0.1.0-pre.2 via
npm ls -g(see below)Node.js version
v22.20.0
Operating system
Windows
Template (if applicable)
all templates
Additional context
This was tested in PowerShell and WSL terminals. Same results in both.
I tested many (but not all) of the templates and received the same error each time.
Additionally:
spfx --versiongives the following error: