vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.49k stars 4.77k forks source link

theme compile bug #852

Open willin opened 5 years ago

willin commented 5 years ago

Bug report

Version

stable latest

Steps to reproduce

log at: https://travis-ci.org/assholev0/v0.chat/jobs/429485113#L452

(undefined) ./node_modules/vuepress-theme-asshole/components/sidebar/player.vue
Module not found: Error: Can't resolve 'aplayer/dist/aplayer.min.css?vue&type=style&index=0&lang=css&' in '/home/travis/build/assholev0/v0.chat/node_modules/vuepress-theme-asshole/components/sidebar'
resolve 'aplayer/dist/aplayer.min.css?vue&type=style&index=0&lang=css&' in '/home/travis/build/assholev0/v0.chat/node_modules/vuepress-theme-asshole/components/sidebar'
  Parsed request is a module
  using description file: /home/travis/build/assholev0/v0.chat/node_modules/vuepress-theme-asshole/package.json (relative path: ./components/sidebar)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules
        using description file: /home/travis/build/assholev0/v0.chat/node_modules/vuepress/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/travis/build/assholev0/v0.chat/node_modules/vuepress/package.json (relative path: ./node_modules/aplayer/dist/aplayer.min.css)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css.jsx doesn't exist
            .vue
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css.vue doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css.json doesn't exist
            .styl
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css.styl doesn't exist
            as directory
              /home/travis/build/assholev0/v0.chat/node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css doesn't exist
      looking for modules in /home/travis/build/assholev0/v0.chat/node_modules
        using description file: /home/travis/build/assholev0/v0.chat/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/travis/build/assholev0/v0.chat/node_modules/aplayer/package.json (relative path: ./dist/aplayer.min.css)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.jsx doesn't exist
            .vue
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.vue doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.json doesn't exist
            .styl
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.styl doesn't exist
            as directory
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css doesn't exist
      /home/travis/build/assholev0/v0.chat/node_modules/vuepress-theme-asshole/components/sidebar/node_modules doesn't exist or is not a directory
      /home/travis/build/assholev0/v0.chat/node_modules/vuepress-theme-asshole/components/node_modules doesn't exist or is not a directory
      /home/travis/build/assholev0/v0.chat/node_modules/vuepress-theme-asshole/node_modules doesn't exist or is not a directory
      /home/travis/build/assholev0/v0.chat/node_modules/node_modules doesn't exist or is not a directory
      /home/travis/build/assholev0/node_modules doesn't exist or is not a directory
      /home/travis/build/node_modules doesn't exist or is not a directory
      /home/travis/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /home/travis/build/assholev0/v0.chat/node_modules
        using description file: /home/travis/build/assholev0/v0.chat/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/travis/build/assholev0/v0.chat/node_modules/aplayer/package.json (relative path: ./dist/aplayer.min.css)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.jsx doesn't exist
            .vue
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.vue doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.json doesn't exist
            .styl
              Field 'browser' doesn't contain a valid alias configuration
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css.styl doesn't exist
            as directory
              /home/travis/build/assholev0/v0.chat/node_modules/aplayer/dist/aplayer.min.css doesn't exist

What is expected?

theme package.json:

{
  "name": "vuepress-theme-asshole",
  "version": "0.0.0-alpha0-20180918",
  "description": "A Vuepress Theme for assholev0",
  "main": "Layout.vue",
  "repository": "git@github.com:assholev0/vuepress-theme-asshole.git",
  "author": "willin <willin@willin.org>",
  "license": "MIT",
  "keywords": [
    "vuepress",
    "theme"
  ],
  "devDependencies": {
    "babel-eslint": "^9.0.0",
    "eslint": "^5.6.0",
    "eslint-config-dwing": "^1.2.1",
    "eslint-import-resolver-webpack": "^0.10.1",
    "eslint-plugin-vue": "^5.0.0-beta.3"
  },
  "dependencies": {
    "aplayer": "^1.10.1",
    "dayjs": "^1.7.5",
    "minireset.css": "^0.0.3"
  }
}

aplayer was installed under theme pack.

What is actually happening?

but it try to load from ./node_modules/vuepress/node_modules/aplayer/dist/aplayer.min.css

besides,

when yarn dev it's ok.

ekoeryanto commented 5 years ago

also happen here my quick solution is adding an alias to the target package

willin commented 5 years ago

how to add alias?

ekoeryanto commented 5 years ago

implementation: https://github.com/apekarawang/apek/blob/48c6da856a017cf6517c87f1bb861fbc1403261f/docs/.vuepress/config.js#L97

docs: https://vuepress.vuejs.org/config/#configurewebpack