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

PHP issue when building #43

Open
cjf339 opened this issue Dec 4, 2024 · 1 comment
Open

PHP issue when building #43

cjf339 opened this issue Dec 4, 2024 · 1 comment

Comments

@cjf339
Copy link

cjf339 commented Dec 4, 2024

Hi there,
I have an issue setting up this Symfony Storybook build on my Windows 11 machine. I've run all the necessary dependencies, I have PHP 8.3 and my PATH is pointing to the correct path under Environment Variables. I am able to run the Symfony server, but when I run Storybook I keep getting an error:

=> Failed to build the preview
Error: Symfony console failed with exit status 1:
CMD: 'php' 'bin/console' 'debug:container' '--parameter=kernel.project_dir' '--format=json' '-v'    
Output:
Error output: ''php'' is not recognized as an internal or external command,
operable program or batch file.

    at <anonymous> (.\vendor\sensiolabs\storybook-bundle\storybook\dist\server\framework-preset.js:54:251)
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:519:28)
    at Pipe.<anonymous> (node:net:337:12)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

I've tried quite a few fixes:

  • Created a new Symfony / Storybook repo from scratch.
  • Reinstalled PHP v8.3 and checked my Environment Variables (under both system and user).
  • Installed WAMP and ran from that PHP version.
  • Installed XAMPP and ran from that PHP version.
  • Uninstalled both WAMP and XAMPP to see if those caused issues.
  • I also tried the latest PHP (v8.4).
@cjf339
Copy link
Author

cjf339 commented Dec 6, 2024

So after some testing, my team and I figured out the issue.

If you navigate to vendor > sensiolabs > storybook-bundle > storybook > dist > server and find the framework-preset.js file. On line 54, replace the child_process.exec with this code:

child_process.exec(s.replace(/'/g, ""),(i,n,r)

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

No branches or pull requests

1 participant