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

Custom theme dependencies when using nmp link #193

Closed
andreasvirkus opened this issue Apr 21, 2018 · 4 comments
Closed

Custom theme dependencies when using nmp link #193

andreasvirkus opened this issue Apr 21, 2018 · 4 comments

Comments

@andreasvirkus
Copy link

When trying to develop the theme locally with npm link, by running this in my Vuepress project root:

npm link ../vuepress-theme-ajv

It complains about dependencies missing theme-side:

ERROR in ../vuepress-theme-ajv/Layout.vue
Module not found: Error: Can't resolve 'vue' in 'C:\Users\antc\code\vuepress-theme-ajv'
 @ ../vuepress-theme-ajv/Layout.vue 24:14-28
 @ ./node_modules/vuepress/lib/app/.temp/routes.js
 @ ./node_modules/vuepress/lib/app/app.js
 @ ./node_modules/vuepress/lib/app/clientEntry.js
 @ multi ./node_modules/vuepress/lib/app/clientEntry.js

ERROR in ../vuepress-theme-ajv/Layout.vue?vue&type=script&lang=js (./node_modules/vue-loader/lib??vue-loader-options!../vuepress-theme-ajv/Layout.vue?vue&type=script&lang=js)
Module not found: Error: Can't resolve 'nprogress' in 'C:\Users\antc\code\vuepress-theme-ajv'
 @ ./node_modules/vue-loader/lib??vue-loader-options!../vuepress-theme-ajv/Layout.vue?vue&type=script&lang=js 19:0-33 56:4-13 60:8-17 66:6-15
 @ ../vuepress-theme-ajv/Layout.vue?vue&type=script&lang=js
 @ ../vuepress-theme-ajv/Layout.vue
 @ ./node_modules/vuepress/lib/app/.temp/routes.js
 @ ./node_modules/vuepress/lib/app/app.js
 @ ./node_modules/vuepress/lib/app/clientEntry.js
 @ multi ./node_modules/vuepress/lib/app/clientEntry.js

But the theme works fine when installing it from the registry:
https://www.npmjs.com/package/vuepress-theme-ajv

@andreasvirkus
Copy link
Author

Also tried setting resolve.symlinks to false in the configureWebpack setting under config.js:

  configureWebpack: {
    resolve: {
      symlinks: false
    }
  },

But the same errors persist

@meteorlxy
Copy link
Member

meteorlxy commented May 12, 2018

    chainWebpack: (config, isServer) => {
        config.resolveLoader
            .modules
            .add(path.resolve(__dirname, './node_modules'))
    }

Can solve it temporarily as described in #353

@ulivz
Copy link
Member

ulivz commented May 16, 2018

Hmmm, cannot reproduced It at my side (OSX), but the solution from @meteorlxy should work for you.

BTW, The mistakes which blocked the build in your project are too much. 😅

@ulivz ulivz closed this as completed May 16, 2018
@ulivz ulivz added the theme label May 16, 2018
@andreasvirkus
Copy link
Author

@ulivz what were the mistakes you encountered?

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

3 participants