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

Build failing #949

Closed
jrappen opened this issue Oct 22, 2018 · 10 comments
Closed

Build failing #949

jrappen opened this issue Oct 22, 2018 · 10 comments

Comments

@jrappen
Copy link

jrappen commented Oct 22, 2018

Bug report

Receiving error upon vuepress build.

Version

$ vuepress --version
1.0.0-alpha.13

Steps to reproduce

  • cd vuepresstest
  • echo "test" > README.md
  • vuepress build

Error on macOS:

TypeError: Cannot read property 'endsWith' of null
    at loadTheme (/***/global/node_modules/@vuepress/core/lib/prepare/loadTheme.js:51:20)
    at AppContext.resolveTheme (/***/global/node_modules/@vuepress/core/lib/prepare/AppContext.js:265:32)
    at AppContext.process (/***/global/node_modules/@vuepress/core/lib/prepare/AppContext.js:72:16)
    at prepare (/***/global/node_modules/@vuepress/core/lib/prepare/index.js:15:20)
    at build (/***/global/node_modules/@vuepress/core/lib/build.js:19:25)
    at args (/***/global/node_modules/@vuepress/cli/index.js:120:14)
    at Command.program.command.description.option.option.option.option.option.action (/***/global/node_modules/@vuepress/cli/index.js:63:25)
    at Command.listener (/***/global/node_modules/@vuepress/cli/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/***/global/node_modules/@vuepress/cli/node_modules/commander/index.js:654:12)

Error on Windows:

 WAIT  Extracting site metadata...

 TIP  Temp directory: C:/Users/***/***/node_modules/vuepress/node_modules/@vuepress/core/.temp
TypeError: Cannot read property 'endsWith' of null
    at loadTheme (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\loadTheme.js:51:20)
    at AppContext.resolveTheme (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\AppContext.js:265:32)
    at AppContext.process (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\AppContext.js:72:16)
    at prepare (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\index.js:15:20)
    at build (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\core\lib\build.js:19:25)
    at args (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\cli\index.js:120:14)
    at Command.program.command.description.option.option.option.option.option.action (C:\Users\***\**\node_modules\vuepress\node_modules\@vuepress\cli\index.js:63:25)
    at Command.listener (C:\Users\***\**\node_modules\vuepress\node_modules\commander\index.js:315:8)
    at emitTwo (events.js:126:13)
    at Command.emit (events.js:214:7)

What is expected?

A basic vuepress build.

What is actually happening?

Error output from above.

Other relevant information

Tested on:

macOS Mojave 10.14 (18A391)
Homebrew 1.7.7
iTerm2 Build 3.2.3
zsh 5.6.2
node v10.12.0 (installed via homebrew)
npm 6.4.1
yarn 1.10.1 (installed via homebrew)
vuepress 1.0.0-alpha.13 (global install via yarn)

and:

Windows 10 Pro x64 1809 Build 17763.55
cmder 1.3.6
node v8.12.0 (portable x64)
npm 6.4.1
vuepress 1.0.0-alpha.13 (global install via npm of portable node)
@x8x
Copy link
Contributor

x8x commented Oct 22, 2018

Same here, after yesterday commits:

 WAIT  Extracting site metadata...

 TIP  Temp directory: /vuepress/packages/@vuepress/core/.temp

 TIP  Apply theme located at /dev/.vuepress/theme...
[vuepress] cannot resolve plugin "/dev/.vuepress/theme"
TypeError: Cannot read property 'startsWith' of undefined
    at PluginAPI.applyPlugin (/vuepress/packages/@vuepress/core/lib/plugin-api/index.js:213:41)
..

@zvinless
Copy link

zvinless commented Oct 23, 2018

This is happening for me whenever I define plugins as an array in my theme's index.js file,

e.g.:

module.exports = {
    plugins: [
        '@vuepress/blog'
    ]
}

fails (as does using require),
but object style, e.g.:

module.exports = {
    plugins: {
        '@vuepress/blog': { }
    }
}

works fine

I'm not sure how to define local, non-package plugins like this, though.

Also, in case things are open for feedback: having various distinct ways of defining plugins on top of shorthands feels kind of contradictory to being minimalistic. It'd be nice to just have one way of doing it so it's clear and easy to remember.

@zvinless
Copy link

e8a35be fixed this for me!

@ulivz
Copy link
Member

ulivz commented Oct 23, 2018

Could you try the latest alpha version: 1.0.0-alpha.16?

@jrappen
Copy link
Author

jrappen commented Oct 23, 2018

@ulivz Problems persist.


macOS Mojave 10.14 (18A391)
Homebrew 1.7.7
iTerm2 Build 3.2.3
zsh 5.6.2
node v10.12.0 (installed via homebrew)
npm 6.4.1
yarn 1.10.1 (installed via homebrew)
vuepress 1.0.0-alpha.16 (global install via yarn)
*****************:~/repos/test|
⇒  yarn docs:build
yarn run v1.10.1
$ vuepress build docs --no-cache

 WAIT  Extracting site metadata...

 TIP  Temp directory: /***/.config/yarn/global/node_modules/@vuepress/core/.temp
TypeError: Cannot read property 'endsWith' of null
    at loadTheme (/***/.config/yarn/global/node_modules/@vuepress/core/lib/prepare/loadTheme.js:53:20)
    at AppContext.resolveTheme (/***/.config/yarn/global/node_modules/@vuepress/core/lib/prepare/AppContext.js:270:32)
    at AppContext.process (/***/.config/yarn/global/node_modules/@vuepress/core/lib/prepare/AppContext.js:77:16)
    at prepare (/***/.config/yarn/global/node_modules/@vuepress/core/lib/prepare/index.js:15:20)
    at build (/***/.config/yarn/global/node_modules/@vuepress/core/lib/build.js:19:21)
    at args (/***/.config/yarn/global/node_modules/@vuepress/cli/index.js:120:14)
    at Command.program.command.description.option.option.option.option.option.action (/***/.config/yarn/global/node_modules/@vuepress/cli/index.js:63:25)
    at Command.listener (/***/.config/yarn/global/node_modules/@vuepress/cli/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/***/.config/yarn/global/node_modules/@vuepress/cli/node_modules/commander/index.js:654:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

screenshot 2018-10-24 at 00 02 35

@x8x
Copy link
Contributor

x8x commented Oct 23, 2018

Thanks @ulivz ! alpha.16 fixed it!
Have to agree with @zvinless , flexibility is nice, but it can be confusing and costly to maintain and document.

@jrappen
Copy link
Author

jrappen commented Oct 24, 2018

@ulivz Problems persist on Windows as well.


Windows 10 Pro x64 1809 Build 17763.55
cmder 1.3.6
node v8.12.0 (portable x64)
npm 6.4.1
vuepress 1.0.0-alpha.16 (global install via npm of portable node)
vuepress build docs --no-cache

 WAIT  Extracting site metadata...

 TIP  Temp directory: ***/node/node_modules/vuepress/node_modules/@vuepress/core/.temp
TypeError: Cannot read property 'endsWith' of null
    at loadTheme (***\node\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\loadTheme.js:53:20)
    at AppContext.resolveTheme (***\node\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\AppContext.js:270:32)
    at AppContext.process (***\node\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\AppContext.js:77:16)
    at prepare (***\node\node_modules\vuepress\node_modules\@vuepress\core\lib\prepare\index.js:15:20)
    at build (***\node\node_modules\vuepress\node_modules\@vuepress\core\lib\build.js:19:21)
    at args (***\node\node_modules\vuepress\node_modules\@vuepress\cli\index.js:120:14)
    at Command.program.command.description.option.option.option.option.option.action (***\node\node_modules\vuepress\node_modules\@vuepress\cli\index.js:63:25)
    at Command.listener (***\node\node_modules\vuepress\node_modules\commander\index.js:315:8)
    at emitTwo (events.js:126:13)
    at Command.emit (events.js:214:7)

image

@ulivz
Copy link
Member

ulivz commented Oct 27, 2018

@jrappen I guess this issue was duplicate of #908 (You are using the globally installed VuePress ), You can try the 1.0.0-alpha.17.

@ulivz ulivz closed this as completed Oct 27, 2018
@jrappen
Copy link
Author

jrappen commented Oct 28, 2018

@ulivz Exact same issue respectively on both macOS and Win10 with 1.0.0-alpha.17 as with 1.0.0-alpha.16.

@jrappen
Copy link
Author

jrappen commented Nov 10, 2018

fixed in 256b7c4 which is part of alpha.20

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

4 participants