1

Trying to setup NextJs JSS and ran only the below simple commands and it fails with below error for the 4th command but this folder/files doesn't exist. None of the below 4 commands creates those files. What am I missing here?

  1. npx create-sitecore-jss
  2. jss setup
  3. jss deploy config
  4. jss deploy app -c -d

enter image description here

Error generating manifest Error: Unable to load manifest require D:\Sitecore\POC_Headless\nextjs\sitecore\definitions\config.js: Error: Cannot find module 'D:\Sitecore\POC_Headless\nextjs\sitecore\definitions\config.js'
9
  • Did you able to see the config files under zzz folder? After running the command jss deploy config? Aug 21 at 7:57
  • @SumitBhatia Yes, I see the .config and deploysecret.config files in the app_config\include\zzz
    – SNew
    Aug 21 at 13:45
  • can you check if you are in the right folder to run the command? I mean try running the deploy command under the folder that contains few folders and files. Like .generated, .next, data, node_modules etc? Aug 21 at 15:19
  • @SumitBhatia the command deploy is being run in the root folder itself as you can see in the above snapshot in the description. It is looking for a file \sitecore\definitions\config.js that doesn't exist so obviously one of the above command is expected to create these files or any other command is required before deploy command
    – SNew
    Aug 21 at 19:22
  • Yes can you try the installation in another folder and check again? Aug 22 at 5:04

1 Answer 1

-1

As per the Sitecore documentation, applications built with JSS for Next.js are deployed differently than apps built with JSS for React, Angular, and Vue.js. The document states the following.

Specifically, when working with JSS for Next.js remember the following:

  • Do not use the JSS CLI commands jss deploy app or jss deploy files.

  • Use jss deploy items for code-first item import.

  • You do not have to configure a sitecoreDistPath in your package.json file.

  • The Link and RichText field helper components support client-side routing out of the box.

  • If you add .graphql files to your solution or make changes to your Sitecore data model (templates), you must update GraphQL introspection.

  • The Next.js app is configured to proxy Sitecore media requests. Therefore, the Layout Service excludes server URLs.

For more information follow this document.

https://doc.sitecore.com/xp/en/developers/hd/200/sitecore-headless-development/sitecore-jss-for-next-js-differences-from-jss-for-react,-angular,-and-vue-js.html

Features:

https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-next-js.html

Hope this helps.

2
  • Please recheck the above picture in the description, the instruction of this command "jss deploy app -c -d" is coming from the latest next js and latest jss version. It fails. See the suggestio provided while app creation by sitecore itself explicitly
    – SNew
    Aug 23 at 16:52
  • The above description is also given in the Sitecore docs. If that is the case then I think a Sitecore support ticket would be a great option to identify the issue. Thanks Aug 24 at 4:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.