Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build on Netlify - Module not found #60

Closed
marchdoe opened this issue Mar 12, 2019 · 2 comments
Closed

Unable to build on Netlify - Module not found #60

marchdoe opened this issue Mar 12, 2019 · 2 comments

Comments

@marchdoe
Copy link

When trying to deploy to Netlify I get the following error.

The app runs locally and builds locally. I have also made sure my Netlify settings are correct based on your instructions.

Error:
Module not found: Error: Can't resolve '../components/Container' in '/opt/buil d/repo/src/pages' 8:46:45 AM: resolve '../components/Container' in '/opt/build/repo/src/pages'

Full output:

8:45:27 AM: Build ready to start
8:45:30 AM: build-image version: 84aca9ba39e0ee86ba194760fbfc51a808f62543
8:45:30 AM: buildbot version: ae7eabf6c88cc6c45c19fb821f4b0a1c2a55238d
8:45:30 AM: Fetching cached dependencies
8:45:31 AM: Starting to download cache of 254.8KB
8:45:31 AM: Finished downloading cache in 70.942969ms
8:45:31 AM: Starting to extract cache
8:45:31 AM: Failed to fetch cache, continuing with build
8:45:31 AM: Starting to prepare the repo for build
8:45:31 AM: No cached dependencies found. Cloning fresh repo
8:45:31 AM: git clone https://github.com/marchdoe/spaceman
8:45:32 AM: Preparing Git Reference refs/heads/master
8:45:32 AM: Starting build script
8:45:32 AM: Installing dependencies
8:45:33 AM: Downloading and installing node v8.15.1...
8:45:33 AM: Downloading https://nodejs.org/dist/v8.15.1/node-v8.15.1-linux-x64.tar.xz...
8:45:34 AM:   0.9
8:45:34 AM: %
8:45:34 AM: 
#####################
8:45:34 AM:               29.6%
8:45:34 AM: ######
8:45:34 AM: ##########################                                          45.0%
8:45:34 AM: 
################################################
8:45:34 AM:                66.8%
8:45:34 AM: 
################################################
8:45:34 AM: ######################## 100.0%
8:45:34 AM: Computing checksum with sha256sum
8:45:34 AM: Checksums matched!
8:45:37 AM: Now using node v8.15.1 (npm v6.4.1)
8:45:37 AM: Attempting ruby version 2.3.6, read from environment
8:45:38 AM: Using ruby version 2.3.6
8:45:39 AM: Using PHP version 5.6
8:45:39 AM: Started restoring cached node modules
8:45:39 AM: Finished restoring cached node modules
8:45:39 AM: Started restoring cached yarn cache
8:45:39 AM: Finished restoring cached yarn cache
8:45:39 AM: Installing yarn at version 1.3.2
8:45:39 AM: Installing Yarn!
8:45:39 AM: > Downloading tarball...
8:45:39 AM: [1/2]: https
8:45:39 AM: ://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz --> /tmp/yarn.tar.gz.CIxTMjM6ri
8:45:39 AM:   % Total    % Received % Xferd
8:45:39 AM:   Average Speed   Time    Time     Time  Current
8:45:39 AM:                                  Dload  Upload   Total   Spent    Left  Speed
8:45:39 AM: 
  0     0
8:45:39 AM:  0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
8:45:39 AM: 
100    91  100    91    0
8:45:39 AM:      0    842      0 --:--:-- --:--:-- --:--:--   850
8:45:39 AM: 
  0     0    0   608
8:45:39 AM:  0     0   1609      0 --:--:-- --:--:-- --:--:--  1609
8:45:40 AM: 
100  865k  100  865k    0     0  1153k      0 --:--
8:45:40 AM: :-- --:--:-- --:--:-- 1153k
8:45:40 AM: [2/2]: https://yarnpkg.com/downloads/1
8:45:40 AM: .3.2/yarn-v1.3.2.tar.gz.asc --> /tmp/yarn.tar.gz.CIxTMjM6ri.asc
8:45:40 AM: 
100    95  100    95    0     0    278
8:45:40 AM:     0 --:--:-- --:--:-- --:--:--   278
100    95  100    95    0     0    278      0 --:--:-- --:--:-- --:--:--     0
8:45:40 AM: 
  0     0    0   612    0     0    980
8:45:40 AM:   0 --:--:-- --:--:-- --:--:--   980
8:45:40 AM: 
100  1027  100  1027    0     0
8:45:40 AM:    1551      0 --:--:-- --:--:-- --:--:--  1551
8:45:40 AM: > Verifying integrity...
8:45:40 AM: gpg: Signature made Thu 02 Nov 2017 04:44:10 PM UTC using RSA key ID FD2497F5
8:45:40 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
8:45:40 AM: gpg: Note: This key has expired!
8:45:40 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
8:45:40 AM:      Subkey fingerprint: 6A01 0C51 6600 6599 AA17  F081 46C2 130D FD24 97F5
8:45:40 AM: > GPG signature looks good
8:45:40 AM: > Extracting to ~/.yarn...
8:45:41 AM: > Adding to $PATH...
8:45:41 AM: > We've added the following to your /opt/buildhome/.profile
8:45:41 AM: > If this isn't the profile of your current shell then please add the following to your correct profile:
8:45:41 AM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
8:45:41 AM: 
8:45:41 AM: > Successfully installed Yarn 1.3.2! Please open another terminal where the `yarn` command will now be available.
8:45:42 AM: Installing NPM modules using Yarn version 1.3.2
8:45:43 AM: yarn install v1.3.2
8:45:43 AM: [1/4] Resolving packages...
8:45:44 AM: [2/4] Fetching packages...
8:46:04 AM: info fsevents@1.2.7: The platform "linux" is incompatible with this module.
8:46:04 AM: info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
8:46:04 AM: [3/4] Linking dependencies...
8:46:04 AM: warning "gatsby > eslint-plugin-graphql@2.1.1" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0".
8:46:04 AM: warning "gatsby > express-graphql@0.6.12" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".
8:46:04 AM: warning "gatsby > graphql-tools@3.1.1" has incorrect peer dependency "graphql@^0.13.0".
8:46:04 AM: warning "gatsby > mini-css-extract-plugin > schema-utils > ajv-errors@1.0.1" has unmet peer dependency "ajv@>=5.0.0".
8:46:04 AM: warning "gatsby-plugin-netlify > webpack-assets-manifest@3.1.1" has unmet peer dependency "webpack@>=4.4.0".
8:46:04 AM: warning "stylelint > postcss-html@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
8:46:04 AM: warning "stylelint > postcss-jsx@0.35.0" has unmet peer dependency "postcss@>=5.0.0".
8:46:04 AM: warning "stylelint > postcss-markdown@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
8:46:04 AM: warning "stylelint > postcss-styled@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
8:46:04 AM: warning "stylelint > postcss-syntax@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
8:46:12 AM: [4/4] Building fresh packages...
8:46:17 AM: Done in 34.11s.
8:46:17 AM: NPM modules installed using Yarn
8:46:17 AM: Started restoring cached go cache
8:46:17 AM: Finished restoring cached go cache
8:46:18 AM: unset GOOS;
8:46:18 AM: unset GOARCH;
8:46:18 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64';
8:46:18 AM: export PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}";
8:46:18 AM: go version >&2;
8:46:18 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env';
8:46:18 AM: go version go1.10 linux/amd64
8:46:18 AM: Installing missing commands
8:46:18 AM: Verify run directory
8:46:18 AM: Executing user command: gatsby build
8:46:21 AM: success open and validate gatsby-configs — 0.012 s
8:46:21 AM: success load plugins — 0.443 s
8:46:22 AM: success onPreInit — 0.892 s
8:46:22 AM: success delete html and css files from previous builds — 0.007 s
8:46:22 AM: success initialize cache — 0.010 s
8:46:22 AM: success copy gatsby files — 0.032 s
8:46:23 AM: success onPreBootstrap — 0.135 s
8:46:23 AM: Starting to fetch data from Contentful
8:46:23 AM: Fetching default locale
8:46:23 AM: default locale is : en-US
8:46:23 AM: contentTypes fetched 5
8:46:23 AM: Updated entries  26
8:46:23 AM: Deleted entries  0
8:46:23 AM: Updated assets  20
8:46:23 AM: Deleted assets  0
8:46:23 AM: Fetch Contentful data: 319.706ms
8:46:23 AM: success source and transform nodes — 0.561 s
8:46:24 AM: success building schema — 0.576 s
8:46:24 AM: success createPages — 0.203 s
8:46:24 AM: success createPagesStatefully — 0.051 s
8:46:24 AM: success onPreExtractQueries — 0.007 s
8:46:24 AM: success update schema — 0.346 s
8:46:24 AM: success extract queries from components — 0.160 s
8:46:25 AM: success run graphql queries — 0.650 s — 30/30 46.28 queries/second
8:46:25 AM: success write out page data — 0.004 s
8:46:25 AM: success write out redirect data — 0.001 s
8:46:25 AM: done generating icons for manifest
8:46:25 AM: success onPostBootstrap — 0.099 s
8:46:25 AM: info bootstrap finished - 7.687 s
8:46:45 AM: error Generating JavaScript bundles failed
8:46:45 AM: 
8:46:45 AM:   Error: ./src/pages/404.js
8:46:45 AM:   Module not found: Error: Can't resolve '../components/Container' in '/opt/buil  d/repo/src/pages'
8:46:45 AM:   resolve '../components/Container' in '/opt/build/repo/src/pages'
8:46:45 AM:     using description file: /opt/build/repo/package.json (relative path: ./src/p  ages)
8:46:45 AM:       Field 'browser' doesn't contain a valid alias configuration
8:46:45 AM:       using description file: /opt/build/repo/package.json (relative path: ./src  /components/Container)
8:46:45 AM:         no extension
8:46:45 AM:           Field 'browser' doesn't contain a valid alias configuration
8:46:45 AM:           /opt/build/repo/src/components/Container doesn't exist
8:46:45 AM:         .mjs
8:46:45 AM:           Field 'browser' doesn't contain a valid alias configuration
8:46:45 AM:           /opt/build/repo/src/components/Container.mjs doesn't exist
8:46:45 AM:         .js
8:46:45 AM:           Field 'browser' doesn't contain a valid alias configuration
8:46:45 AM:           /opt/build/repo/src/components/Container.js doesn't exist
8:46:45 AM:         .jsx
8:46:45 AM:           Field 'browser' doesn't contain a valid alias configuration
8:46:45 AM:           /opt/build/repo/src/components/Container.jsx doesn't exist
8:46:45 AM:         .wasm
8:46:45 AM:           Field 'browser' doesn't contain a valid alias configuration
8:46:46 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:46:45 AM:           /opt/build/repo/src/components/Container.wasm doesn't exist
8:46:45 AM:         .json
8:46:45 AM:           Field 'browser' doesn't contain a valid alias configuration
8:46:45 AM:           /opt/build/repo/src/components/Container.json doesn't exist
8:46:46 AM: Shutting down logging, 253 messages pending
@marchdoe
Copy link
Author

Created an issue too soon, ended up finding the answer here => gatsbyjs/gatsby#8205

Although I am not sure why the suggested change seems to fix it.

@ryanwiemer
Copy link
Owner

Thanks for letting me know that you were able to figure this out on your own.

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

No branches or pull requests

2 participants