Error: Can't resolve 'vue-carousel/src/index' in '/opt/build/repo/src/pages' Gridsome

Hello everyone

I am trying to deploy gridsome wordpress site but…
Please check log.
7:23:41 PM: Build ready to start
7:23:43 PM: build-image version: 09c2cdcdf242cf2f57c9ee0fcad9d298fad9ad41
7:23:43 PM: build-image tag: v3.5.0
7:23:43 PM: buildbot version: 172aa31cb336bae73f9eb30159b9f95fe46f2e63
7:23:44 PM: Fetching cached dependencies
7:23:44 PM: Failed to fetch cache, continuing with build
7:23:44 PM: Starting to prepare the repo for build
7:23:44 PM: No cached dependencies found. Cloning fresh repo
7:23:44 PM: git clone https://github.com/navedhn/gridwp
7:23:45 PM: Preparing Git Reference refs/heads/main
7:23:47 PM: Starting build script
7:23:47 PM: Installing dependencies
7:23:47 PM: Python version set to 2.7
7:23:49 PM: v12.18.0 is already installed.
7:23:50 PM: Now using node v12.18.0 (npm v6.14.4)
7:23:50 PM: Started restoring cached build plugins
7:23:50 PM: Finished restoring cached build plugins
7:23:50 PM: Attempting ruby version 2.7.1, read from environment
7:23:52 PM: Using ruby version 2.7.1
7:23:52 PM: Using PHP version 5.6
7:23:52 PM: Started restoring cached node modules
7:23:52 PM: Finished restoring cached node modules
7:23:53 PM: Installing NPM modules using NPM version 6.14.4
7:24:23 PM: > sharp@0.25.4 install /opt/build/repo/node_modules/sharp
7:24:23 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
7:24:25 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
7:24:28 PM: > core-js@3.7.0 postinstall /opt/build/repo/node_modules/core-js
7:24:28 PM: > node -e β€œtry{require(’./postinstall’)}catch(e){}”
7:24:28 PM: > cwebp-bin@5.1.0 postinstall /opt/build/repo/node_modules/cwebp-bin
7:24:28 PM: > node lib/install.js
7:24:29 PM: :heavy_check_mark: cwebp pre-build test passed successfully
7:24:29 PM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg
7:24:29 PM: > node lib/install.js
7:24:29 PM: :heavy_check_mark: mozjpeg pre-build test passed successfully
7:24:30 PM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin
7:24:30 PM: > node lib/install.js
7:24:30 PM: :heavy_check_mark: pngquant pre-build test passed successfully
7:24:30 PM: > bootstrap-vue@2.19.0 postinstall /opt/build/repo/node_modules/bootstrap-vue
7:24:30 PM: > opencollective || exit 0
7:24:32 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents):
7:24:32 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
7:24:32 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
7:24:32 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
7:24:32 PM: added 1420 packages from 756 contributors and audited 1426 packages in 38.516s
7:24:33 PM: 61 packages are looking for funding
7:24:33 PM: run npm fund for details
7:24:33 PM: found 0 vulnerabilities
7:24:34 PM: NPM modules installed
7:24:34 PM: Started restoring cached go cache
7:24:34 PM: Finished restoring cached go cache
7:24:34 PM: go version go1.14.4 linux/amd64
7:24:34 PM: go version go1.14.4 linux/amd64
7:24:34 PM: Installing missing commands
7:24:34 PM: Verify run directory
7:24:36 PM: ​
7:24:36 PM: ────────────────────────────────────────────────────────────────
7:24:36 PM: Netlify Build
7:24:36 PM: ────────────────────────────────────────────────────────────────
7:24:36 PM: ​
7:24:36 PM: ❯ Version
7:24:36 PM: @netlify/build 5.3.2
7:24:36 PM: ​
7:24:36 PM: ❯ Flags
7:24:36 PM: deployId: 5fb7d16ddfd2180009ba7c44
7:24:36 PM: mode: buildbot
7:24:36 PM: ​
7:24:36 PM: ❯ Current directory
7:24:36 PM: /opt/build/repo
7:24:36 PM: ​
7:24:36 PM: ❯ Config file
7:24:36 PM: /opt/build/repo/netlify.toml
7:24:36 PM: ​
7:24:36 PM: ❯ Context
7:24:36 PM: production
7:24:36 PM: ​
7:24:36 PM: ────────────────────────────────────────────────────────────────
7:24:36 PM: 1. build.command from netlify.toml
7:24:36 PM: ────────────────────────────────────────────────────────────────
7:24:36 PM: ​
7:24:36 PM: $ gridsome build
7:24:37 PM: Gridsome v0.7.22
7:24:38 PM: Initializing plugins…
7:24:38 PM: Loading data from https://coderzinn.com/gridsome
7:24:48 PM: Load sources - 9.81s
7:24:48 PM: Create GraphQL schema - 0.25s
7:24:48 PM: Create pages and templates - 0.08s
7:24:48 PM: Generate temporary code - 0.05s
7:24:48 PM: Bootstrap finish - 11.24s
7:24:48 PM: Compiling assets…
7:25:11 PM: Error: Can’t resolve β€˜vue-carousel/src/index’ in β€˜/opt/build/repo/src/pages’ at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:209:21
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:285:5
7:25:11 PM: at eval (eval at create (/opt/build/repo/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), :13:1)
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:285:5
7:25:11 PM: at eval (eval at create (/opt/build/repo/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), :13:1)
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:285:5
7:25:11 PM: at eval (eval at create (/opt/build/repo/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), :25:1)
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:285:5
7:25:11 PM: at eval (eval at create (/opt/build/repo/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), :26:1)
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:30:40
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:285:5
7:25:11 PM: at eval (eval at create (/opt/build/repo/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), :13:1)
7:25:11 PM: at /opt/build/repo/node_modules/enhanced-resolve/lib/Resolver.js:285:5
7:25:11 PM: at eval (eval at create (/opt/build/repo/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), :14:1)
7:25:11 PM: ​
7:25:11 PM: ────────────────────────────────────────────────────────────────
7:25:11 PM: β€œbuild.command” failed
7:25:11 PM: ────────────────────────────────────────────────────────────────
7:25:11 PM: ​
7:25:11 PM: Error message
7:25:11 PM: Command failed with exit code 1: gridsome build
7:25:11 PM: ​
7:25:11 PM: Error location
7:25:11 PM: In build.command from netlify.toml:
7:25:11 PM: gridsome build
7:25:11 PM: ​
7:25:11 PM: Resolved config
7:25:11 PM: build:
7:25:11 PM: command: gridsome build
7:25:11 PM: commandOrigin: config
7:25:11 PM: publish: /opt/build/repo/dist
7:25:12 PM: Caching artifacts
7:25:12 PM: Started saving node modules
7:25:12 PM: Finished saving node modules
7:25:12 PM: Started saving build plugins
7:25:12 PM: Finished saving build plugins
7:25:12 PM: Started saving pip cache
7:25:12 PM: Finished saving pip cache
7:25:12 PM: Started saving emacs cask dependencies
7:25:12 PM: Finished saving emacs cask dependencies
7:25:12 PM: Started saving maven dependencies
7:25:12 PM: Finished saving maven dependencies
7:25:12 PM: Started saving boot dependencies
7:25:12 PM: Finished saving boot dependencies
7:25:12 PM: Started saving go dependencies
7:25:12 PM: Finished saving go dependencies
7:25:15 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:25:15 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
7:25:15 PM: Failing build: Failed to build site
7:25:16 PM: Finished processing build request in 1m32.814446215s

I not sure where is culprit. same code was working fine with static site. but with wordpress i am haiving problem,

Here is link for static gridsome page.

You can’t deploy a WordPress website on Netlify. At max, you can use WordPress as a Headless CMS, but, that instance of WordPress has to be hosted somewhere else.

If you’re just using WordPress as a headless CMS like I mentioned (I suppose you’re), we might need to check your repo.

Id you see log WordPress is hosted on other place.

7:24:38 PM: Loading data from https://coderzinn.com/gridsome

Just a bit late to notice it.

The error usually means that there was a problem locating one of your files and in many cases, it happens because of case sensitive file names.

1 Like

I think its not a issue. if its case senstive probelm then it should not work on https://musing-lichterman-a19b25.netlify.app/

Both Sites have same slider code. it does not make sence at all.

It’s difficult to guess then. If everything else is same and the only difference is between statically generating and sourcing from Wordpress, then, there’s something wrong going on while fetching from Wordpress, maybe. Or, it’s some Node Module that’s acting up?

Is the build working locally?

Yes its working perfect locally.

Seems like you will have to wait till someone more experienced with Gridsome can answer.

I might also suggest, @wordpresslab, that you try building locally to see if you can narrow down the fault when you can interact with the build environment. Here’s how:

Our staff doesn’t have more experience with gridsome, so I think it unlikely that you’ll find any gridsome specific advice here so maybe better to actively debug than hope and wait :slight_smile: