During Heroku Post Build, Cannot find file












0















This is a react application, with styled components, with a Node backend being deployed to Heroku via git push heroku master



I import the style for each component from a separate file with import {...} from './style'.



Where the file structure is:



OptionsCarousel
|index.js
|style.js



This makes perfect sense to me, and works locally both via npm start and npm run build -> serve -s build. With no issues. But when deploying to Heroku, during the optimization build stage, it fails with the error:




remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/OptionsCarousel/index.js
remote: Cannot find file './style' in './src/OptionsCarousel'.



Any advice on a better way to structure this, and what is causing the issue would be greatly appreciated.










share|improve this question























  • Heroku builds from master as a default (you can deploy from another branch tho). Are you sure that you've added/committed all your files to master and then done git push heroku master or however you're deploying your code. FWIW I use the same component structure (CSS modules rather than CSS in JS) and had no issues with pushing to heroku.

    – Andy
    Dec 28 '18 at 14:54













  • Thanks @Andy, good to hear that I haven't lost my marbles. I am committing to master and using git push heroku master, I may investigate how heroku caches files, as the entire structure has been changed to accommodate styled-components. So, it may be associated with that.

    – Elis Jones
    Dec 28 '18 at 15:18






  • 1





    Yeah. You can clear the build cache with these instructions. Hope you fix it ok.

    – Andy
    Dec 28 '18 at 20:55











  • Cheers @Andy, clearing the cache resolved the issue!

    – Elis Jones
    Jan 3 at 12:03
















0















This is a react application, with styled components, with a Node backend being deployed to Heroku via git push heroku master



I import the style for each component from a separate file with import {...} from './style'.



Where the file structure is:



OptionsCarousel
|index.js
|style.js



This makes perfect sense to me, and works locally both via npm start and npm run build -> serve -s build. With no issues. But when deploying to Heroku, during the optimization build stage, it fails with the error:




remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/OptionsCarousel/index.js
remote: Cannot find file './style' in './src/OptionsCarousel'.



Any advice on a better way to structure this, and what is causing the issue would be greatly appreciated.










share|improve this question























  • Heroku builds from master as a default (you can deploy from another branch tho). Are you sure that you've added/committed all your files to master and then done git push heroku master or however you're deploying your code. FWIW I use the same component structure (CSS modules rather than CSS in JS) and had no issues with pushing to heroku.

    – Andy
    Dec 28 '18 at 14:54













  • Thanks @Andy, good to hear that I haven't lost my marbles. I am committing to master and using git push heroku master, I may investigate how heroku caches files, as the entire structure has been changed to accommodate styled-components. So, it may be associated with that.

    – Elis Jones
    Dec 28 '18 at 15:18






  • 1





    Yeah. You can clear the build cache with these instructions. Hope you fix it ok.

    – Andy
    Dec 28 '18 at 20:55











  • Cheers @Andy, clearing the cache resolved the issue!

    – Elis Jones
    Jan 3 at 12:03














0












0








0








This is a react application, with styled components, with a Node backend being deployed to Heroku via git push heroku master



I import the style for each component from a separate file with import {...} from './style'.



Where the file structure is:



OptionsCarousel
|index.js
|style.js



This makes perfect sense to me, and works locally both via npm start and npm run build -> serve -s build. With no issues. But when deploying to Heroku, during the optimization build stage, it fails with the error:




remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/OptionsCarousel/index.js
remote: Cannot find file './style' in './src/OptionsCarousel'.



Any advice on a better way to structure this, and what is causing the issue would be greatly appreciated.










share|improve this question














This is a react application, with styled components, with a Node backend being deployed to Heroku via git push heroku master



I import the style for each component from a separate file with import {...} from './style'.



Where the file structure is:



OptionsCarousel
|index.js
|style.js



This makes perfect sense to me, and works locally both via npm start and npm run build -> serve -s build. With no issues. But when deploying to Heroku, during the optimization build stage, it fails with the error:




remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/OptionsCarousel/index.js
remote: Cannot find file './style' in './src/OptionsCarousel'.



Any advice on a better way to structure this, and what is causing the issue would be greatly appreciated.







javascript reactjs heroku






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 28 '18 at 14:26









Elis JonesElis Jones

8710




8710













  • Heroku builds from master as a default (you can deploy from another branch tho). Are you sure that you've added/committed all your files to master and then done git push heroku master or however you're deploying your code. FWIW I use the same component structure (CSS modules rather than CSS in JS) and had no issues with pushing to heroku.

    – Andy
    Dec 28 '18 at 14:54













  • Thanks @Andy, good to hear that I haven't lost my marbles. I am committing to master and using git push heroku master, I may investigate how heroku caches files, as the entire structure has been changed to accommodate styled-components. So, it may be associated with that.

    – Elis Jones
    Dec 28 '18 at 15:18






  • 1





    Yeah. You can clear the build cache with these instructions. Hope you fix it ok.

    – Andy
    Dec 28 '18 at 20:55











  • Cheers @Andy, clearing the cache resolved the issue!

    – Elis Jones
    Jan 3 at 12:03



















  • Heroku builds from master as a default (you can deploy from another branch tho). Are you sure that you've added/committed all your files to master and then done git push heroku master or however you're deploying your code. FWIW I use the same component structure (CSS modules rather than CSS in JS) and had no issues with pushing to heroku.

    – Andy
    Dec 28 '18 at 14:54













  • Thanks @Andy, good to hear that I haven't lost my marbles. I am committing to master and using git push heroku master, I may investigate how heroku caches files, as the entire structure has been changed to accommodate styled-components. So, it may be associated with that.

    – Elis Jones
    Dec 28 '18 at 15:18






  • 1





    Yeah. You can clear the build cache with these instructions. Hope you fix it ok.

    – Andy
    Dec 28 '18 at 20:55











  • Cheers @Andy, clearing the cache resolved the issue!

    – Elis Jones
    Jan 3 at 12:03

















Heroku builds from master as a default (you can deploy from another branch tho). Are you sure that you've added/committed all your files to master and then done git push heroku master or however you're deploying your code. FWIW I use the same component structure (CSS modules rather than CSS in JS) and had no issues with pushing to heroku.

– Andy
Dec 28 '18 at 14:54







Heroku builds from master as a default (you can deploy from another branch tho). Are you sure that you've added/committed all your files to master and then done git push heroku master or however you're deploying your code. FWIW I use the same component structure (CSS modules rather than CSS in JS) and had no issues with pushing to heroku.

– Andy
Dec 28 '18 at 14:54















Thanks @Andy, good to hear that I haven't lost my marbles. I am committing to master and using git push heroku master, I may investigate how heroku caches files, as the entire structure has been changed to accommodate styled-components. So, it may be associated with that.

– Elis Jones
Dec 28 '18 at 15:18





Thanks @Andy, good to hear that I haven't lost my marbles. I am committing to master and using git push heroku master, I may investigate how heroku caches files, as the entire structure has been changed to accommodate styled-components. So, it may be associated with that.

– Elis Jones
Dec 28 '18 at 15:18




1




1





Yeah. You can clear the build cache with these instructions. Hope you fix it ok.

– Andy
Dec 28 '18 at 20:55





Yeah. You can clear the build cache with these instructions. Hope you fix it ok.

– Andy
Dec 28 '18 at 20:55













Cheers @Andy, clearing the cache resolved the issue!

– Elis Jones
Jan 3 at 12:03





Cheers @Andy, clearing the cache resolved the issue!

– Elis Jones
Jan 3 at 12:03












1 Answer
1






active

oldest

votes


















1














As per @Andy's comment, I needed to clear the cache as I had made significant changes to the file structure in the repository. I followed these instructions to do that.






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%2f53960033%2fduring-heroku-post-build-cannot-find-file%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    As per @Andy's comment, I needed to clear the cache as I had made significant changes to the file structure in the repository. I followed these instructions to do that.






    share|improve this answer




























      1














      As per @Andy's comment, I needed to clear the cache as I had made significant changes to the file structure in the repository. I followed these instructions to do that.






      share|improve this answer


























        1












        1








        1







        As per @Andy's comment, I needed to clear the cache as I had made significant changes to the file structure in the repository. I followed these instructions to do that.






        share|improve this answer













        As per @Andy's comment, I needed to clear the cache as I had made significant changes to the file structure in the repository. I followed these instructions to do that.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 12:05









        Elis JonesElis Jones

        8710




        8710






























            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%2f53960033%2fduring-heroku-post-build-cannot-find-file%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

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas