Symfony bundle Twig auto namespace not registered?registering Bundle to symfony kernelSpecify alternative fallback paths for Symfony to find twig templates for bundlestwig_js bundle with Symfony 2.3How to make Assetic work with resources defined with Twig namespaces?Autoload Bundle with custom path in Symfony2Symfony bundle inheritance and twig templates overridingSymfony assets relative to bundleSymfony - FOS UserBundle Error: “Attempted to load class 'User' from namespace…” by opening the /register PageSymfony: Namespaced bundle not loaded correctlySymfony 3.4 Use view inside my bundle

Can a Resident Assistant be told to ignore a lawful order?'

What details should I consider before agreeing for part of my salary to be 'retained' by employer?

Pi 3 B+ no audio device found

Does the Intel 8085 CPU use real memory addresses?

What were the problems on the Apollo 11 lunar module?

Vienna To Graz By Rail

What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?

Coverting list of string into integers and reshaping the original list

Is this artwork (used in a video game) real?

How to honestly answer questions from a girlfriend like "How did you find this place" without giving the impression I'm always talking about my exes?

Where do the electrons come from to make the carbon stable during bombardment of alpha particles on beryllium

How should one refer to knights (& dames) in academic writing?

My credit card has no magnetic stripe. Is this a problem in the USA?

How to remove the first colon ':' from a timestamp?

ROT13 encoder/decoder

How would you say "Sorry, that was a mistake on my part"?

Wordplay subtraction paradox

Creating lines connecting each possible pair of points in PostGIS?

Why does pip3 install in ~/.local on Debian?

Playing saxophone without using the octave key

Is the purpose of sheet music to be played along to? Or a guide for learning and reference during playing?

Credit card details stolen every 1-2 years. What am I doing wrong?

Is passive Investigation essentially truesight against illusions?

How to find abandoned railways in Google Maps?



Symfony bundle Twig auto namespace not registered?


registering Bundle to symfony kernelSpecify alternative fallback paths for Symfony to find twig templates for bundlestwig_js bundle with Symfony 2.3How to make Assetic work with resources defined with Twig namespaces?Autoload Bundle with custom path in Symfony2Symfony bundle inheritance and twig templates overridingSymfony assets relative to bundleSymfony - FOS UserBundle Error: “Attempted to load class 'User' from namespace…” by opening the /register PageSymfony: Namespaced bundle not loaded correctlySymfony 3.4 Use view inside my bundle






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have an "AppBundle" in my Symfony ( 3.4 ) Project and everthing is running fine in dev, but when deployed on production Server, I get following error:



There are no registered paths for namespace "App".


I use the twig namespace notation @Appdirtemplatefile that should automatically be registered according to the docs. When I run console debug:twig I can see that there is no @App twig namespace registered.
Suprisingly, I have a second Bundle called PackagingBundle, and the namespace Packaging of that bundle is well registered.



How can this be ? Where are those namespaces defined ? Is there a file for that that I could modify ?










share|improve this question




























    1















    I have an "AppBundle" in my Symfony ( 3.4 ) Project and everthing is running fine in dev, but when deployed on production Server, I get following error:



    There are no registered paths for namespace "App".


    I use the twig namespace notation @Appdirtemplatefile that should automatically be registered according to the docs. When I run console debug:twig I can see that there is no @App twig namespace registered.
    Suprisingly, I have a second Bundle called PackagingBundle, and the namespace Packaging of that bundle is well registered.



    How can this be ? Where are those namespaces defined ? Is there a file for that that I could modify ?










    share|improve this question
























      1












      1








      1








      I have an "AppBundle" in my Symfony ( 3.4 ) Project and everthing is running fine in dev, but when deployed on production Server, I get following error:



      There are no registered paths for namespace "App".


      I use the twig namespace notation @Appdirtemplatefile that should automatically be registered according to the docs. When I run console debug:twig I can see that there is no @App twig namespace registered.
      Suprisingly, I have a second Bundle called PackagingBundle, and the namespace Packaging of that bundle is well registered.



      How can this be ? Where are those namespaces defined ? Is there a file for that that I could modify ?










      share|improve this question














      I have an "AppBundle" in my Symfony ( 3.4 ) Project and everthing is running fine in dev, but when deployed on production Server, I get following error:



      There are no registered paths for namespace "App".


      I use the twig namespace notation @Appdirtemplatefile that should automatically be registered according to the docs. When I run console debug:twig I can see that there is no @App twig namespace registered.
      Suprisingly, I have a second Bundle called PackagingBundle, and the namespace Packaging of that bundle is well registered.



      How can this be ? Where are those namespaces defined ? Is there a file for that that I could modify ?







      symfony twig






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 9:17









      minychillominychillo

      2402 silver badges10 bronze badges




      2402 silver badges10 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          0














          You have to set this in the composer.json by setting autoloader path:



           "autoload": 
          "psr-4":
          "App\": "src/"

          ,


          But for Bundles, in SF4 you have to set in the file config/bundles.php.






          share|improve this answer

























          • Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

            – minychillo
            Mar 26 at 10:59












          • yes, there's really no namespace for 'App', but for 'AppBundle\', yes

            – hoover_D
            Mar 26 at 11:01











          • But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

            – minychillo
            Mar 26 at 11:01











          • is this error about Twig? did you do a bin/console debug:twig ?

            – hoover_D
            Mar 26 at 11:06











          • doa composer dump-autoload

            – hoover_D
            Mar 26 at 11:09


















          0














          My mistake was that I named the views folder in my AppBundle Views , with uppercase "V". I don't know why it worked on dev server and not on prod, that is just one of those mysteries.



          Anyway, a stupid mistake that coast me a lot of time, so maybe this post can help someone save some time.






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353467%2fsymfony-bundle-twig-auto-namespace-not-registered%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You have to set this in the composer.json by setting autoloader path:



             "autoload": 
            "psr-4":
            "App\": "src/"

            ,


            But for Bundles, in SF4 you have to set in the file config/bundles.php.






            share|improve this answer

























            • Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

              – minychillo
              Mar 26 at 10:59












            • yes, there's really no namespace for 'App', but for 'AppBundle\', yes

              – hoover_D
              Mar 26 at 11:01











            • But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

              – minychillo
              Mar 26 at 11:01











            • is this error about Twig? did you do a bin/console debug:twig ?

              – hoover_D
              Mar 26 at 11:06











            • doa composer dump-autoload

              – hoover_D
              Mar 26 at 11:09















            0














            You have to set this in the composer.json by setting autoloader path:



             "autoload": 
            "psr-4":
            "App\": "src/"

            ,


            But for Bundles, in SF4 you have to set in the file config/bundles.php.






            share|improve this answer

























            • Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

              – minychillo
              Mar 26 at 10:59












            • yes, there's really no namespace for 'App', but for 'AppBundle\', yes

              – hoover_D
              Mar 26 at 11:01











            • But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

              – minychillo
              Mar 26 at 11:01











            • is this error about Twig? did you do a bin/console debug:twig ?

              – hoover_D
              Mar 26 at 11:06











            • doa composer dump-autoload

              – hoover_D
              Mar 26 at 11:09













            0












            0








            0







            You have to set this in the composer.json by setting autoloader path:



             "autoload": 
            "psr-4":
            "App\": "src/"

            ,


            But for Bundles, in SF4 you have to set in the file config/bundles.php.






            share|improve this answer















            You have to set this in the composer.json by setting autoloader path:



             "autoload": 
            "psr-4":
            "App\": "src/"

            ,


            But for Bundles, in SF4 you have to set in the file config/bundles.php.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 26 at 11:00

























            answered Mar 26 at 10:57









            hoover_Dhoover_D

            3901 silver badge7 bronze badges




            3901 silver badge7 bronze badges












            • Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

              – minychillo
              Mar 26 at 10:59












            • yes, there's really no namespace for 'App', but for 'AppBundle\', yes

              – hoover_D
              Mar 26 at 11:01











            • But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

              – minychillo
              Mar 26 at 11:01











            • is this error about Twig? did you do a bin/console debug:twig ?

              – hoover_D
              Mar 26 at 11:06











            • doa composer dump-autoload

              – hoover_D
              Mar 26 at 11:09

















            • Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

              – minychillo
              Mar 26 at 10:59












            • yes, there's really no namespace for 'App', but for 'AppBundle\', yes

              – hoover_D
              Mar 26 at 11:01











            • But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

              – minychillo
              Mar 26 at 11:01











            • is this error about Twig? did you do a bin/console debug:twig ?

              – hoover_D
              Mar 26 at 11:06











            • doa composer dump-autoload

              – hoover_D
              Mar 26 at 11:09
















            Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

            – minychillo
            Mar 26 at 10:59






            Mine is like this .. wrong ?: "autoload": { "psr-4": "AppBundle\": "src/AppBundle", "PackagingBundle\": "src/PackagingBundle", , ... it does work on dev AND for the PackagingBundle ? But I will give it a try ..

            – minychillo
            Mar 26 at 10:59














            yes, there's really no namespace for 'App', but for 'AppBundle\', yes

            – hoover_D
            Mar 26 at 11:01





            yes, there's really no namespace for 'App', but for 'AppBundle\', yes

            – hoover_D
            Mar 26 at 11:01













            But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

            – minychillo
            Mar 26 at 11:01





            But how come it works for Packaging and on dev ? Anyway, thank you, will give it a try ..

            – minychillo
            Mar 26 at 11:01













            is this error about Twig? did you do a bin/console debug:twig ?

            – hoover_D
            Mar 26 at 11:06





            is this error about Twig? did you do a bin/console debug:twig ?

            – hoover_D
            Mar 26 at 11:06













            doa composer dump-autoload

            – hoover_D
            Mar 26 at 11:09





            doa composer dump-autoload

            – hoover_D
            Mar 26 at 11:09













            0














            My mistake was that I named the views folder in my AppBundle Views , with uppercase "V". I don't know why it worked on dev server and not on prod, that is just one of those mysteries.



            Anyway, a stupid mistake that coast me a lot of time, so maybe this post can help someone save some time.






            share|improve this answer



























              0














              My mistake was that I named the views folder in my AppBundle Views , with uppercase "V". I don't know why it worked on dev server and not on prod, that is just one of those mysteries.



              Anyway, a stupid mistake that coast me a lot of time, so maybe this post can help someone save some time.






              share|improve this answer

























                0












                0








                0







                My mistake was that I named the views folder in my AppBundle Views , with uppercase "V". I don't know why it worked on dev server and not on prod, that is just one of those mysteries.



                Anyway, a stupid mistake that coast me a lot of time, so maybe this post can help someone save some time.






                share|improve this answer













                My mistake was that I named the views folder in my AppBundle Views , with uppercase "V". I don't know why it worked on dev server and not on prod, that is just one of those mysteries.



                Anyway, a stupid mistake that coast me a lot of time, so maybe this post can help someone save some time.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 27 at 9:23









                minychillominychillo

                2402 silver badges10 bronze badges




                2402 silver badges10 bronze badges



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353467%2fsymfony-bundle-twig-auto-namespace-not-registered%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript