Skip to content
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

Cannot Initialize New Project w/ Next.js & nextjs-styleguide #1825

Open
bstaruk opened this issue Jun 17, 2024 · 6 comments
Open

Cannot Initialize New Project w/ Next.js & nextjs-styleguide #1825

bstaruk opened this issue Jun 17, 2024 · 6 comments
Labels

Comments

@bstaruk
Copy link

bstaruk commented Jun 17, 2024

Describe the Bug

It is currently impossible to initialize and start a new JSS project on a Macbook with an Apple Silicon chip, using Next.js and the nextjs-styleguide boilerplate.

To Reproduce

  1. Initialize a fresh project with the current settings. Everything was left default, except for selecting the nextjs-styleguide addon initializer in the last step:
Screenshot 2024-06-17 at 12 43 52 PM
  1. cd nextjs to navigate into the project directory
  2. npm run start to start the project

This results in:

> sitecore-jss-app@22.0.0 start
> cross-env NODE_ENV=development JSS_MODE=disconnected "npm-run-all --serial bootstrap --parallel next:dev start:disconnected-proxy start:watch-components"

node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm-run-all --serial bootstrap --parallel next:dev start:disconnected-proxy start:watch-components ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn npm-run-all --serial bootstrap --parallel next:dev start:disconnected-proxy start:watch-components',
  path: 'npm-run-all --serial bootstrap --parallel next:dev start:disconnected-proxy start:watch-components',
  spawnargs: []
}

Node.js v20.14.0

Expected Behavior

Given this is a fresh installation, the app should run without erroring/crashing.

Possible Fix

No response

Provide environment information

  • Sitecore Version: None (attempting to run in disconnected mode for now)
  • JSS Version: 22.0.0 (latest)
  • Browser Name and version: Mac Terminal
  • Operating System and version (desktop or mobile): Mac OS 14.5 (latest) on a 14" MacBook Pro w/ M3 Pro chip
@art-alexeyenko
Copy link
Contributor

@bstaruk
Thank you for the report. We saw some issues with config formattign causing build issues on Macs. They should be fixed via #1791 and included in the next upcoming release.
You can apply it ( extra .trim() in scripts/generate-config) right now however, the fix is app-level only.

@bnmn1895
Copy link

bnmn1895 commented Jul 31, 2024

I am running into the same issue even after applying the fix with adding the .trim(). Is there any update on this?

@yavorsk
Copy link
Contributor

yavorsk commented Jul 31, 2024

Hi @bnmn1895, what version of jss are you using? The fix for this issue is part of v22.1.0.

@bnmn1895
Copy link

I tried following the docs so I guess it still was v21.x.

@larserhardsen
Copy link

larserhardsen commented Nov 26, 2024

I see the same problem with JSS 22.2.1 on my MacBook Pro with a M1 chip. Replacing cross-env with cross-env-shell in the package.json file makes things start up.

@yavorsk
Copy link
Contributor

yavorsk commented Dec 16, 2024

hey @larserhardsen thanks for providing the workaround.
we need to include some proper testing for mac os users, so I've added a topic for our team to discuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants