nelmio / NelmioCorsBundle

Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
https://symfony.com/bundles/NelmioCorsBundle/
MIT License
1.89k stars 108 forks source link

Attempted to load class "NelmioCorsBundle" #93

Closed ObadaAbdelkareem closed 1 year ago

ObadaAbdelkareem commented 6 years ago

I have included the NelmioCorsBundle on the AppKernel.php like below :

    public function registerBundles(): array
    {
        $bundles = [
            new \Sylius\Bundle\AdminBundle\SyliusAdminBundle(),
            new \Sylius\Bundle\ShopBundle\SyliusShopBundle(),

            new \FOS\OAuthServerBundle\FOSOAuthServerBundle(), // Required by SyliusAdminApiBundle.
            new \Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle(),
            new Nelmio\CorsBundle\NelmioCorsBundle(),
            new \AppBundle\AppBundle(),
        ];

but still give me this error

Attempted to load class "NelmioCorsBundle" from namespace "Nelmio\CorsBundle".Did you forget a "use" statement for another namespace?

 can

stefandoorn commented 6 years ago

Have you required it via Composer also?

composer require nelmio/cors-bundle

carnau commented 6 years ago

Maybe he forgot to execute composer install.

ricardosaracino commented 6 years ago

Name space does not start with a slash

thomasrm commented 5 years ago

Any progress regarding this issue? I'm having the exact same one.

I installed CorsBundle with composer require nelmio/cors-bundle

Thanks!

ayyoub-afwallah commented 3 years ago

composer require nelmio/cors-bundle works !