Skip to content

Error: Cannot find module #443

Closed
Closed
@collymore

Description

@collymore

I'm trying to use a Vue component from the node_modules folder. It works correctly when running as vuepress dev but not when vuepress build

Installed with Yarn by running
yarn add vue-carousel-3d

and imported within
.vuepress/enhanceApp.js

import { Carousel3d } from 'vue-carousel-3d';

export default ({
    Vue, // the version of Vue being used in the VuePress app
    options, // the options for the root Vue instance
    router, // the router instance for the app
    siteData // site metadata
  }) => {
    Vue.component('carousel3d', Carousel3d);
}

Runing Vuepress build returns

Rendering static HTML...
Rendering page: /Error rendering /:
Error: Cannot find module 'vue-carousel-3d'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at r (/Users/lukecollymore/.config/yarn/global/node_modules/vue-server-renderer/build.js:8335:16)
    at Object.module.exports.__WEBPACK_AMD_DEFINE_FACTORY__ (webpack:/external "vue-carousel-3d":1:0)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at Object.<anonymous> (server-bundle.js:3315:33)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at Object.<anonymous> (server-bundle.js:3634:18)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at server-bundle.js:103:18
    at Object.<anonymous> (server-bundle.js:106:10)
    at evaluateModule (/Users/lukecollymore/.config/yarn/global/node_modules/vue-server-renderer/build.js:8338:21)
    at /Users/lukecollymore/.config/yarn/global/node_modules/vue-server-renderer/build.js:8396:18
    at new Promise (<anonymous>)

What else do I need to do for this to build?

  • OSX 10.13.2
  • Node.js v8.9.1
  • Yarn 1.6.0
  • VuePress 0.8.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions