Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Module not found: Error: Can't resolve '@vueuse/sound' in 'node_modules/.cache/nuxt' #1

Closed
l2D opened this issue Mar 9, 2021 · 2 comments

Comments

@l2D
Copy link

l2D commented Mar 9, 2021

I deploy to Cloudflare pages with nuxt generate build command and got this error.

Timestamp Details
11:16:02.382 ERROR in ./node_modules/.cache/nuxt/sound.js
11:16:02.382 Module not found: Error: Can't resolve '@vueuse/sound' in 'node_modules/.cache/nuxt'
11:16:02.382 @ ./node_modules/.cache/nuxt/sound.js 6:0-41 52:36-44
11:16:02.383 @ ./node_modules/.cache/nuxt/index.js
11:16:02.383 @ ./node_modules/.cache/nuxt/client.js
11:16:02.383 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./node_modules/.cache/nuxt/client.js
Full log
11:12:06.223 Initializing build environment
11:14:54.740 Finished
11:14:54.740 Cloning repo
11:14:58.982 Finished
11:15:00.526 Installing dependencies
11:15:00.528 Python version set to 2.7
11:15:01.567 v12.18.0 is already installed.
11:15:02.030 Now using node v12.18.0 (npm v6.14.4)
11:15:02.070 Started restoring cached build plugins
11:15:02.073 Finished restoring cached build plugins
11:15:02.199 Attempting ruby version 2.7.1, read from environment
11:15:03.148 Using ruby version 2.7.1
11:15:03.397 Using PHP version 5.6
11:15:03.423 5.2 is already installed.
11:15:03.428 Using Swift version 5.2
11:15:03.429 Started restoring cached node modules
11:15:03.431 Finished restoring cached node modules
11:15:03.602 Installing NPM modules using NPM version 6.14.4
11:15:04.345 npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
11:15:28.061  
11:15:28.061 > @fortawesome/fontawesome-common-types@0.2.34 postinstall /opt/buildhome/repo/node_modules/@fortawesome/fontawesome-common-types
11:15:28.061 > node attribution.js
11:15:28.061  
11:15:28.119 Font Awesome Free 0.2.34 by @FontAwesome - https://fontawesome.com
11:15:28.119 License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:15:28.119  
11:15:28.167  
11:15:28.167 > core-js@2.6.12 postinstall /opt/buildhome/repo/node_modules/core-js
11:15:28.167 > node -e "try{require('./postinstall')}catch(e){}"
11:15:28.167  
11:15:28.223 �[96mThank you for using core-js (�[94m https://github.com/zloirock/core-js �[96m) for polyfilling JavaScript standard library!�[0m
11:15:28.223  
11:15:28.223 �[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: �[0m
11:15:28.223 �[96m>�[94m https://opencollective.com/core-js �[0m
11:15:28.224 �[96m>�[94m https://www.patreon.com/zloirock �[0m
11:15:28.224  
11:15:28.224 �[96mAlso, the author of core-js (�[94m https://github.com/zloirock �[96m) is looking for a good job -)�[0m
11:15:28.224  
11:15:28.318  
11:15:28.318 > vue-demi@0.7.1 postinstall /opt/buildhome/repo/node_modules/nuxt-use-sound/node_modules/@vueuse/sound/node_modules/vue-demi
11:15:28.318 > node ./scripts/postinstall.js
11:15:28.318  
11:15:28.534  
11:15:28.535 > vue-demi@0.6.2 postinstall /opt/buildhome/repo/node_modules/vue-demi
11:15:28.535 > node ./scripts/postinstall.js
11:15:28.535  
11:15:28.652  
11:15:28.652 > @fortawesome/fontawesome-svg-core@1.2.34 postinstall /opt/buildhome/repo/node_modules/@fortawesome/fontawesome-svg-core
11:15:28.652 > node attribution.js
11:15:28.652  
11:15:28.700 Font Awesome Free 1.2.34 by @FontAwesome - https://fontawesome.com
11:15:28.700 License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:15:28.700  
11:15:28.726  
11:15:28.726 > @fortawesome/free-solid-svg-icons@5.15.2 postinstall /opt/buildhome/repo/node_modules/@fortawesome/free-solid-svg-icons
11:15:28.726 > node attribution.js
11:15:28.726  
11:15:28.776 Font Awesome Free 5.15.2 by @FontAwesome - https://fontawesome.com
11:15:28.776 License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:15:28.776  
11:15:28.786  
11:15:28.786 > nuxt@2.15.2 postinstall /opt/buildhome/repo/node_modules/nuxt
11:15:28.786 > opencollective || exit 0
11:15:28.786  
11:15:28.984  
11:15:28.984 :-:
11:15:28.985 .==-+:
11:15:28.985 .==. :+- .-=-
11:15:28.985 .==. :==++-+=.
11:15:28.985 :==. -**: :+=.
11:15:28.985 :+- :*+++. .++.
11:15:28.985 :+- -*= .++: .=+.
11:15:28.985 -+: =- .+: .=+:
11:15:28.985 -+: .=- .=- =+:
11:15:28.985 .==: .+: -- -+-
11:15:28.985 .=+:.....:+-.........:==..=*-
11:15:28.985 .-=------=++============++====:
11:15:28.985  
11:15:28.985 Thanks for installing nuxtjs
11:15:28.985 Please consider donating to our open collective
11:15:28.985 to help us maintain this package.
11:15:28.985  
11:15:28.985 Number of contributors: 0
11:15:28.986 Number of backers: 409
11:15:28.986 Annual budget: $70,336
11:15:28.986 Current balance: $3,725
11:15:28.986  
11:15:28.986 Donate: https://opencollective.com/nuxtjs/donate
11:15:28.987  
11:15:30.290 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
11:15:30.290 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:15:30.291 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
11:15:30.291 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:15:30.292  
11:15:30.301 added 1481 packages from 669 contributors in 26.009s
11:15:31.269  
11:15:31.269 106 packages are looking for funding
11:15:31.269 run npm fund for details
11:15:31.269  
11:15:31.309 NPM modules installed
11:15:31.562 Installing Hugo 0.54.0
11:15:32.068 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
11:15:32.070 Started restoring cached go cache
11:15:32.075 Finished restoring cached go cache
11:15:32.102 go version go1.14.4 linux/amd64
11:15:32.108 go version go1.14.4 linux/amd64
11:15:32.109 Installing missing commands
11:15:32.109 Verify run directory
11:15:32.109 Executing user command: nuxt generate
11:15:32.381  
11:15:32.381 WARN sass-loader@10.1.0 is installed but ^10.1.1 is expected
11:15:32.381  
11:16:02.382  
11:16:02.382 FATAL Nuxt build error
11:16:02.382  
11:16:02.382 ERROR in ./node_modules/.cache/nuxt/sound.js
11:16:02.382 Module not found: Error: Can't resolve '@vueuse/sound' in 'node_modules/.cache/nuxt'
11:16:02.382 @ ./node_modules/.cache/nuxt/sound.js 6:0-41 52:36-44
11:16:02.383 @ ./node_modules/.cache/nuxt/index.js
11:16:02.383 @ ./node_modules/.cache/nuxt/client.js
11:16:02.383 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./node_modules/.cache/nuxt/client.js
11:16:02.383  
11:16:02.386  
11:16:02.386 ╭─────────────────────────────╮
11:16:02.386 │ │
11:16:02.386 │ ✖ Nuxt Fatal Error │
11:16:02.386 │ │
11:16:02.386 │ Error: Nuxt build error │
11:16:02.386 │ │
11:16:02.386 ╰─────────────────────────────╯
11:16:02.386  
11:16:02.529 Failed: build command exited with code: 1
@l2D
Copy link
Author

l2D commented Mar 24, 2021

After installing @vueuse/sound manually, It deploys success on Vercel and Cloud Run but I got this error, and the website on Cloud Run shows Server error. (Vercel not shows Server error, and work fine)

Vercel :

image

07:45:36.985 TypeError: Cannot read property 'observable' of undefined
07:45:36.985 at L (/vercel/workpath0/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:2303)
07:45:36.985 at Z (/vercel/workpath0/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:3275)
07:45:36.985 at Object.F [as ref] (/vercel/workpath0/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:1103)
07:45:36.985 at useSound (/vercel/workpath0/node_modules/@vueuse/sound/dist/cjs/index.js:13:37)
07:45:36.986 at app.setup (node_modules/.cache/nuxt/sound.js:40:0)
07:45:36.986 at server.js:4399:91
07:45:36.986 at server.js:4342:17
07:45:36.986 at ke (node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:0)
07:45:36.986 at server.js:4341:52
07:45:36.986 at bn.r.data (node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:0)
07:45:36.986 at /vercel/workpath0/node_modules/vue/dist/vue.runtime.common.prod.js:6:28667
07:45:36.986 at /vercel/workpath0/node_modules/vue/dist/vue.runtime.common.prod.js:6:28727
07:45:36.987 at pn (/vercel/workpath0/node_modules/vue/dist/vue.runtime.common.prod.js:6:28934)
07:45:36.987 at bn.e._init (/vercel/workpath0/node_modules/vue/dist/vue.runtime.common.prod.js:6:32700)
07:45:36.987 at new bn (/vercel/workpath0/node_modules/vue/dist/vue.runtime.common.prod.js:6:30160)
07:45:36.987 at module.exports.webpack_exports.default (node_modules/.cache/nuxt/server.js:86:0)
Cloud Run log :

image

image

@l2D
Copy link
Author

l2D commented Mar 27, 2021

Solved by composition-api #415

  • Add @vueuse/sound and vue to dependencies
// package.json
  "dependencies": {
    ....,
    "@vueuse/sound": "^1.1.7",
    "vue": "^2.6.12"
  },
  • Add vue to build.transpile
// nuxt.config.js

build: {
    transpile: ['vue'],
}

@l2D l2D closed this as completed Mar 27, 2021
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

1 participant