0

Node JS version: v14.15.3, JSS Version: 15.0.1, Mode: Disconnected, Issue: Not able to add my first component into the “jss-main” place holder

Following are the steps:-

  1. I have created a JSS application using React. localhost:3000 successfully show the default page.
  2. I have then created my first component using JSS SCAFFOLD
  3. Application and component were created successfully
  4. I could able to see “MyFirstComponent.sitecore.js under ../sitecore/definintions/component
  5. I could able to see en.yml under data/routes

follow are the code i have tried. JSS return the below error. Please advice.

placeholders:
  jss-main:
      **componentName: MyFirstComponent
      fields:
        heading: test**      
    - componentName: ContentBlock
      fields:
        heading: Welcome to Sitecore JSSss
 
  1. I couldn’t able to add my component into the “jss-main” place holder
LOG File:-
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli  'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli  'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli  'run',
1 verbose cli  'start',
1 verbose cli  '--'
1 verbose cli ]
2 info using npm@6.14.9
3 info using node@v14.15.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle jss-react-sample@15.0.1~prestart: jss-react-sample@15.0.1
6 info lifecycle jss-react-sample@15.0.1~start: jss-react-sample@15.0.1
7 verbose lifecycle jss-react-sample@15.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle jss-react-sample@15.0.1~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\repos\jss-react-sample\node_modules\.bin;C:\Program Files\Microsoft MPI\Bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\wamp64\bin\php\php7.3.21;C:\Program Files (x86)\dotnet\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs\;C:\Users\Dell\AppData\Local\Microsoft\WindowsApps;C:\Users\Dell\.dotnet\tools;C:\Users\Dell\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Dell\AppData\Roaming\npm
9 verbose lifecycle jss-react-sample@15.0.1~start: CWD: D:\repos\jss-react-sample
10 silly lifecycle jss-react-sample@15.0.1~start: Args: [
10 silly lifecycle  '/d /s /c',
10 silly lifecycle  'npm-run-all --serial bootstrap:disconnected --parallel start:react start:proxy start:watch-components'
10 silly lifecycle ]
11 silly lifecycle jss-react-sample@15.0.1~start: Returned: code: 1 signal: null
12 info lifecycle jss-react-sample@15.0.1~start: Failed to exec start script
13 verbose stack Error: jss-react-sample@15.0.1 start: `npm-run-all --serial bootstrap:disconnected --parallel start:react start:proxy start:watch-components`
13 verbose stack Exit status 1
13 verbose stack    at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack    at EventEmitter.emit (events.js:315:20)
13 verbose stack    at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack    at ChildProcess.emit (events.js:315:20)
13 verbose stack    at maybeClose (internal/child_process.js:1048:16)
13 verbose stack    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid jss-react-sample@15.0.1
15 verbose cwd D:\repos\jss-react-sample
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start" "--"
18 verbose node v14.15.3
19 verbose npm v6.14.9
20 error code ELIFECYCLE
21 error errno 1
22 error jss-react-sample@15.0.1 start: `npm-run-all --serial bootstrap:disconnected --parallel start:react start:proxy start:watch-components`
22 error Exit status 1
23 error Failed at the jss-react-sample@15.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

**Console error:-**
Route data file not found: D:\repos\jss-react-sample\data\routes\en.(yaml|yml|json).
The route will not be added to the manifest. Empty folders can cause this warning.
TypeError: Cannot read property 'name' of undefined
   at D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-jss-manifest\dist\generator\traversal.js:22:90
   at Array.forEach ()
   at traverseInternal (D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-jss-manifest\dist\generator\traversal.js:21:19)
   at Object.exports.traverseItems (D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-jss-manifest\dist\generator\traversal.js:29:5)
   at Object.default (D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-jss-manifest\dist\generator\pipelines\generatePlaceholders\extractPlaceholdersFromItems.js:25:17)
   at D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-pipelines\dist\pipeline.js:100:54
   at step (D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-pipelines\dist\pipeline.js:44:23)
   at Object.next (D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-pipelines\dist\pipeline.js:25:53)
   at fulfilled (D:\repos\jss-react-sample\node_modules\@sitecore-jss\sitecore-pipelines\dist\pipeline.js:16:58)
   at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR! code ELIFECYCLE

1
  • Is that ** actually in your route? Double check your yaml format, appears that you are missing a - in the yaml array for your new component. – nickwesselman Feb 11 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.