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

Attempted to load class "GenericLinkProvider" from namespace "Fig\Link". Did you forget a "use" statement for "Symfony\Component\WebLink\GenericLinkProvider" #83

Closed
sabruss opened this issue Nov 24, 2019 · 3 comments · Fixed by #84

Comments

@sabruss
Copy link

sabruss commented Nov 24, 2019

Symfony version(s) affected: 5

Description
Attempted to load class "GenericLinkProvider" from namespace "Fig\Link". Did you forget a "use" statement for "Symfony\Component\WebLink\GenericLinkProvider"

How to reproduce
create new project symfony/skeleton
composer req encore
activate preload

webpack_encore:
    preload: true

in config/package/webpack_encore.yaml

composer req web-link as requested by the bundle

Possible Solution
change namespace from Fig\Link to Symfony\Component\WebLink in Symfony\WebpackEncoreBundle\EventListener\PreLoadAssetsEventListener

@mbabker
Copy link

mbabker commented Nov 25, 2019

It seems like the preload feature is relying on symfony/web-link to install fig/link-utils (so this bundle is using the FIG package as a transient dependency), but since the WebLink component no longer relies on this package as of 4.4, this check is no longer good enough to protect against turning on an optional feature without all dependencies.

@stephanvierkant
Copy link

Same problem here, using Symfony 4.4. Installing composer require fig/link-util solves it, but shouldn't be required.

@mbabker Small typo: package is called fig/link-util, without trailing s.

@weaverryan
Copy link
Member

Fixed in v1.7.2. Thanks for the clear report!

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

Successfully merging a pull request may close this issue.

4 participants