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

PackageJsonSynchronizer is not fail safe #1015

Open
nicolas-grekas opened this issue Feb 20, 2024 · 2 comments
Open

PackageJsonSynchronizer is not fail safe #1015

nicolas-grekas opened this issue Feb 20, 2024 · 2 comments

Comments

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Feb 20, 2024

The other day, I ran composer require webapp on a skeleton app during a workshop and this failed like that:

  • Configuring symfony/asset-mapper (>=6.4): From github.com/symfony/recipes:main
    Executing script importmap:require [KO]
    [KO]
    Script importmap:require returned with error code 1
    !!
    !! In ErrorChunk.php line 56:
    !!
    !! Could not resolve host: data.jsdelivr.com for "https://data.jsdelivr.com/v1
    !! /packages/npm/@hotwired/stimulus/resolved?specifier=%5E3.0.0".
    !!
    !!
    !! In CurlResponse.php line 315:
    !!
    !! Could not resolve host: data.jsdelivr.com for "https://data.jsdelivr.com/v1
    !! /packages/npm/@hotwired/stimulus/resolved?specifier=%5E3.0.0".
    !!
    !!
    !! importmap:require [--entrypoint] [--path PATH] [--] ...

Either we had bad network or jsdelivr was having troubles, but this means installing a webapp pack is not failsafe: if an error occurs in the middle of installing recipes, the app ends up in a f*cked up state. I ran recipes:install and that fixed the last recipes but I don't expect newcomers to know how to overcome this issue.

But I think PackageJsonSynchronizer shouldn't do that in the first place.

Instead, it should delegate doing anything with the network to a later state - e.g. when cache:clear is ran.

That's my current understanding of the issue and at this stage this might be enough for @weaverryan to follow up? 👼 🙏 💪

@kbond
Copy link
Member

kbond commented Apr 16, 2024

I think I have a similar issue but when running composer recipe:update. When the update leaves you with git conflicts, executing importmap:require gives a similar error to above.

@krasnabiotech
Copy link

krasnabiotech commented Sep 29, 2024

The other day, I ran composer require webapp on a skeleton app during a workshop and this failed like that:

  • Configuring symfony/asset-mapper (>=6.4): From github.com/symfony/recipes:main
    Executing script importmap:require [KO]
    [KO]
    Script importmap:require returned with error code 1
    !!
    !! In ErrorChunk.php line 56:
    !!
    !! Could not resolve host: data.jsdelivr.com for "https://data.jsdelivr.com/v1
    !! /packages/npm/@hotwired/stimulus/resolved?specifier=%5E3.0.0".
    !!
    !!
    !! In CurlResponse.php line 315:
    !!
    !! Could not resolve host: data.jsdelivr.com for "https://data.jsdelivr.com/v1
    !! /packages/npm/@hotwired/stimulus/resolved?specifier=%5E3.0.0".
    !!
    !!
    !! importmap:require [--entrypoint] [--path PATH] [--] ...

Either we had bad network or jsdelivr was having troubles, but this means installing a webapp pack is not failsafe: if an error occurs in the middle of installing recipes, the app ends up in a f*cked up state. I ran recipes:install and that fixed the last recipes but I don't expect newcomers to know how to overcome this issue.

But I think PackageJsonSynchronizer shouldn't do that in the first place.

Instead, it should delegate doing anything with the network to a later state - e.g. when cache:clear is ran.

That's my current understanding of the issue and at this stage this might be enough for @weaverryan to follow up? 👼 🙏 💪

Hi nicolas, I'm a newcomer and I encountered the same issue as you did. Could you please elaborate on how to fix this issue?
I just tried running 'composer symfony:recipes:install' like you mentioned. However, it failed again and returned me the same error message as before. I hope you can see my comment and give me some help. I look forward to you reply!

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

3 participants