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

Deploy - remote: Module not found: Error: Can't resolve #71

Closed
bluengreen opened this issue Oct 1, 2017 · 4 comments
Closed

Deploy - remote: Module not found: Error: Can't resolve #71

bluengreen opened this issue Oct 1, 2017 · 4 comments

Comments

@bluengreen
Copy link

bluengreen commented Oct 1, 2017

Have scoured the issues of create-react-app, react-app-rewired, and here. Nothing absolutely nothing works and the only place it does NOT build is on heroku. Locally - fine. I can get it to build correctly if I remove the files in question. However, there seems to be no explanation. I have tried renaming the files, checked the case of the file names, checked the encoding, checked thee import / export, everything is just like other files. The only way it will build on heroku is if I take the files out.

I'm using node 7.7.3 and npm 4.1.2, and yarn 1.0.2 on my development machine. Can this be that the build pack is using node 6.11.3 and npm 3.10.10?

pnovess@:~/Projects/marketplace-front (pn-deploy)$ git push heroku pn-deploy:master 
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (16/16), 1.47 KiB | 0 bytes/s, done.
Total 16 (delta 10), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> React.js (create-react-app) multi app detected
remote: -----> Configure create-react-app build environment
remote:        Using `NODE_ENV=development`
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
remote: =====> Detected Framework: Multipack
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
remote: =====> Detected Framework: Node.js
remote: 
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=false
remote:        NODE_VERBOSE=false
remote:        NODE_PATH=src
remote:        NODE_ENV=development
remote:        NODE_MODULES_CACHE=true
remote: 
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:        engines.yarn (package.json):  unspecified (use default)
remote:        
remote:        Resolving node version 6.x...
remote:        Downloading and installing node 6.11.3...
remote:        Using default npm version: 3.10.10
remote:        Resolving yarn version 0.28.4...
remote:        Downloading and installing yarn (0.28.4)...
remote:        Installed yarn 0.28.4
remote: 
remote: -----> Restoring cache
remote:        Loading 2 from cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (not cached - skipping)
remote: 
remote: -----> Building dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v0.28.4
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
remote:        info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
remote:        [3/4] Linking dependencies...
remote:        warning "babel-preset-react-app@3.0.3" has incorrect peer dependency "babel-runtime@^6.23.0".
remote:        warning "less-loader@4.0.5" has incorrect peer dependency "less@^2.3.1".
remote:        warning "less-loader@4.0.5" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0".
remote:        warning "babel-loader@7.1.1" has incorrect peer dependency "webpack@2 || 3".
remote:        warning "babel-preset-react-app@3.0.2" has incorrect peer dependency "babel-runtime@^6.23.0".
remote:        warning "eslint-config-react-app@2.0.0" has incorrect peer dependency "babel-eslint@^7.2.3".
remote:        warning "eslint-config-react-app@2.0.0" has incorrect peer dependency "eslint@^4.1.1".
remote:        warning "eslint-config-react-app@2.0.0" has incorrect peer dependency "eslint-plugin-flowtype@^2.34.1".
remote:        warning "eslint-config-react-app@2.0.0" has incorrect peer dependency "eslint-plugin-import@^2.6.0".
remote:        warning "eslint-config-react-app@2.0.0" has incorrect peer dependency "eslint-plugin-jsx-a11y@^5.1.1".
remote:        warning "eslint-config-react-app@2.0.0" has incorrect peer dependency "eslint-plugin-react@^7.1.0".
remote:        warning "eslint-loader@1.9.0" has incorrect peer dependency "eslint@>=1.6.0 <5.0.0".
remote:        warning "eslint-plugin-flowtype@2.35.0" has incorrect peer dependency "eslint@>=2.0.0".
remote:        warning "eslint-plugin-import@2.7.0" has incorrect peer dependency "eslint@2.x - 4.x".
remote:        warning "eslint-plugin-jsx-a11y@5.1.1" has incorrect peer dependency "eslint@^2.10.2 || ^3 || ^4".
remote:        warning "eslint-plugin-react@7.1.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0".
remote:        warning "extract-text-webpack-plugin@3.0.0" has incorrect peer dependency "webpack@^3.1.0".
remote:        warning "html-webpack-plugin@2.29.0" has incorrect peer dependency "webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3".
remote:        warning "sw-precache-webpack-plugin@0.11.4" has incorrect peer dependency "webpack@^1 || ^2 || ^2.1.0-beta || ^2.2.0-beta || ^3".
remote:        warning "url-loader@0.5.9" has incorrect peer dependency "file-loader@*".
remote:        warning "webpack-dev-server@2.7.1" has incorrect peer dependency "webpack@^2.2.0 || ^3.0.0".
remote:        warning "webpack-manifest-plugin@1.2.1" has incorrect peer dependency "webpack@1 || 2 || 3".
remote:        warning "ajv-keywords@2.1.0" has incorrect peer dependency "ajv@>=5.0.0".
remote:        warning "uglifyjs-webpack-plugin@0.4.6" has incorrect peer dependency "webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0".
remote:        warning "webpack-dev-middleware@1.12.0" has incorrect peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
remote:        warning "ajv-keywords@1.5.1" has incorrect peer dependency "ajv@>=4.10.0".
remote:        warning The case-insensitive file /tmp/build_c5ec285c733802f0d269daa12dece80f/node_modules/antd/node_modules shouldn't be copied twice in one bulk copy
remote:        [4/4] Building fresh packages...
remote:        Done in 41.52s.
remote: 
remote: -----> Caching build
remote:        Clearing previous node cache
remote:        Saving 2 cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (nothing to cache)
remote: 
remote: -----> Build succeeded!
remote: =====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git
remote: =====> Detected Framework: React.js (create-react-app)
remote:        Writing `static.json` to support create-react-app
remote:        Enabling runtime environment variables
remote: 
remote: > marketplace-front@0.1.0 build /tmp/build_c5ec285c733802f0d269daa12dece80f
remote: > react-app-rewired build
remote: 
remote: Creating an optimized production build...
remote: Failed to compile.
remote: 
remote: Module not found: Error: Can't resolve 'views/pages/Profile' in '/tmp/build_c5ec285c733802f0d269daa12dece80f/src'
remote: 
remote: 
remote: 
remote: npm ERR! Linux 3.13.0-128-generic
remote: npm ERR! argv "/tmp/build_c5ec285c733802f0d269daa12dece80f/.heroku/node/bin/node" "/tmp/build_c5ec285c733802f0d269daa12dece80f/.heroku/node/bin/npm" "run" "build"
remote: npm ERR! node v6.11.3
remote: npm ERR! npm  v3.10.10
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! marketplace-front@0.1.0 build: `react-app-rewired build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the marketplace-front@0.1.0 build script 'react-app-rewired build'.
remote: npm ERR! Make sure you have the latest version of node.js and npm installed.
remote: npm ERR! If you do, this is most likely a problem with the marketplace-front package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR!     react-app-rewired build
remote: npm ERR! You can get information on how to open an issue for this project with:
remote: npm ERR!     npm bugs marketplace-front
remote: npm ERR! Or if that isn't available, you can get their info via:
remote: npm ERR!     npm owner ls marketplace-front
remote: npm ERR! There is likely additional logging output above.
remote: 
remote: npm ERR! Please include the following file with any support request:
remote: npm ERR!     /tmp/build_c5ec285c733802f0d269daa12dece80f/npm-debug.log
remote:  !     Push rejected, failed to compile React.js (create-react-app) multi app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to marketplace-front.
remote: 
To https://git.heroku.com/marketplace-front.git
 ! [remote rejected] pn-deploy -> master (pre-receive hook declined)
@jmorrell
Copy link

jmorrell commented Oct 1, 2017

I'm using node 7.7.3 and npm 4.1.2, and yarn 1.0.2 on my development machine. Can this be that the build pack is using node 6.11.3 and npm 3.10.10?

That's a good place to start. You can specify version in package.json: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

Are you working locally on Windows by chance?

@jmorrell
Copy link

jmorrell commented Oct 1, 2017

Related webpack issue thread: webpack/webpack#981

@bluengreen
Copy link
Author

UGH!!!! Feel like a major idiot. It was a case change in the path. Github doesn't update case changes!!! Thanks for the help.

@mars
Copy link
Owner

mars commented May 1, 2018

Letter casing: upper versus lower case filenames.

For example:

If a module is included with import Profile from 'views/pages/Profile' but the actual filename committed to git is views/pages/profile.js, then this kind of failure will occur.

To fix, move it in the repo to the expected casing:

git mv views/pages/profile.js views/pages/Profile.js
git commit . -m "fix module filename casing"

…or change the module's import statement to match the filename's case:

import Profile from 'views/pages/profile'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants