Skip to content
This repository was archived by the owner on Jun 11, 2022. It is now read-only.
This repository was archived by the owner on Jun 11, 2022. It is now read-only.

Module not found error with "subdir" buildpack #198

Description

@deepan96

I am trying to deploy my react app to heroku which runs perfectly fine on local. But I keep seeing the error "Module not found: Error: Can't resolve './redux/store' in '/tmp/build_f1f2b62e/src' " even though the file is present. Any help is appreciated. I am also attaching the build log below:

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. https://github.com/timanovsky/subdir-heroku-buildpack.git
2. heroku/nodejs
-----> Subdir buildpack app detected
-----> Subdir buildpack in client
creating cache: /tmp/codon/tmp/cache
created tmp dir: /tmp/codon/tmp/cache/subdir9DNL7
moving working dir: client to /tmp/codon/tmp/cache/subdir9DNL7
cleaning build dir /tmp/build_f1f2b62e
copying preserved work dir from cache /tmp/codon/tmp/cache/subdir9DNL7 to build dir /tmp/build_f1f2b62e
cleaning tmp dir /tmp/codon/tmp/cache/subdir9DNL7
-----> Node.js app detected

-----> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_VERBOSE=false
   NODE_ENV=production
   NODE_MODULES_CACHE=false

-----> Installing binaries
engines.node (package.json): 14.8.0
engines.npm (package.json): unspecified (use default)

   Resolving node version 14.8.0...
   Downloading and installing node 14.8.0...
   Using default npm version: 6.14.7

-----> Restoring cache
Caching has been disabled because NODE_MODULES_CACHE=false

-----> Installing dependencies
Installing node modules

   > styled-components@5.3.5 postinstall /tmp/build_f1f2b62e/node_modules/styled-components
   > node ./postinstall.js
   
   
   > core-js@3.21.1 postinstall /tmp/build_f1f2b62e/node_modules/core-js
   > node -e "try{require('./postinstall')}catch(e){}"
   
   
   > core-js-pure@3.21.1 postinstall /tmp/build_f1f2b62e/node_modules/core-js-pure
   > node -e "try{require('./postinstall')}catch(e){}"
   
   added 1585 packages in 18.786s

-----> Build
Running build

   > client@0.1.0 build /tmp/build_f1f2b62e
   > react-scripts build
   
   Creating an optimized production build...
   Failed to compile.
   
   Module not found: Error: Can't resolve './redux/store' in '/tmp/build_f1f2b62e/src'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.u2qg2/_logs/2022-04-27T05_20_08_537Z-debug.log
-----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys
   
   If you're stuck, please submit a ticket so we can help:
   https://help.heroku.com/
   
   Love,
   Heroku

! Push rejected, failed to compile Node.js app.
! Push failed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions