Vuepress: Module build failed: TypeError: Cannot read property 'join' of undefined

Created on 15 Apr 2018  ·  15Comments  ·  Source: vuejs/vuepress

I install vuepress globally and create README file,then I input vuepress dev,The following thing happened:

image

My OS is Win10~

Most helpful comment

Do not use echo command on win10, create the mardown file directly.

All 15 comments

  VuePress dev server listening at http://localhost:8080/

× 「wdm」: Hash: 841239360a93a2459297
Version: webpack 4.5.0
Time: 15381ms
Built at: 2018-4-15 11:10:23
                         Asset       Size  Chunks             Chunk Names
assets/img/search.83621669.svg  216 bytes          [emitted]
              assets/js/app.js   1.75 MiB     app  [emitted]  app
                assets/js/0.js  750 bytes       0  [emitted]
                    index.html  303 bytes          [emitted]
Entrypoint app = assets/js/app.js
[../../../../AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/polyfill.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/polyfill.js 86 bytes {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/routes.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/routes.js 359 bytes {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/siteData.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/siteData.js 146 bytes {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/lib/app/app.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/app.js 1.68 KiB {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/lib/app/clientEntry.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/clientEntry.js 1.88 KiB {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/node_modules/object-assign/index.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/node_modules/object-assign/index.js 2.06 KiB {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/node_modules/register-service-worker/index.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/node_modules/register-service-worker/index.js 3.32 KiB {app} [built]
[../../../../AppData/Roaming/npm/node_modules/vuepress/node_modules/url/url.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/node_modules/url/url.js 22.8 KiB {app} [built]
[../../../../node_modules/loglevelnext/dist/loglevelnext.js] C:/Users/blow/node_modules/loglevelnext/dist/loglevelnext.js 18.9 KiB {app} [built]
[../../../../node_modules/webpack-hot-client/client/hot.js] C:/Users/blow/node_modules/webpack-hot-client/client/hot.js 4.91 KiB {app} [built]
[../../../../node_modules/webpack-hot-client/client/index.js?8e59b3c5-b07b-4bba-b350-2b456f37072e] C:/Users/blow/node_modules/webpack-hot-client/client?8e59b3c5-b07b-4bba-b350-2b456f37072e 1.86 KiB {app} [built]
[../../../../node_modules/webpack-hot-client/client/log.js] C:/Users/blow/node_modules/webpack-hot-client/client/log.js 2.4 KiB {app} [built]
[../../../../node_modules/webpack-hot-client/client/socket.js] C:/Users/blow/node_modules/webpack-hot-client/client/socket.js 1.39 KiB {app} [built]
   [0] multi C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/clientEntry.js 28 bytes {app} [built]
   [1] multi webpack-hot-client/client?8e59b3c5-b07b-4bba-b350-2b456f37072e C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/clientEntry.js 40 bytes {app} [built]
    + 115 hidden modules

ERROR in ./README.md
Module build failed: TypeError: Cannot read property 'join' of undefined
    at Object.module.exports (C:\Users\blow\AppData\Roaming\npm\node_modules\vuepress\lib\webpack\markdownLoader.js:81:17)
 @ C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/.temp/routes.js 10:8-85
 @ C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/app.js
 @ C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/clientEntry.js
 @ multi C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/clientEntry.js
Child html-webpack-plugin for "index.html":
         Asset      Size  Chunks  Chunk Names
    index.html  1.38 MiB       0
    Entrypoint undefined = index.html
    [../../../../AppData/Roaming/npm/node_modules/vuepress/node_modules/html-webpack-plugin/lib/loader.js!../../../../AppData/Roaming/npm/node_modules/vuepress/lib/app/index.dev.html] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/node_modules/html-webpack-plugin/lib/loader.js!C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/lib/app/index.dev.html 447 bytes {0} [built]
    [../../../../AppData/Roaming/npm/node_modules/vuepress/node_modules/lodash/lodash.js] C:/Users/blow/AppData/Roaming/npm/node_modules/vuepress/node_modules/lodash/lodash.js 527 KiB {0} [built]
    [../../../../AppData/Roaming/npm/node_modules/vuepress/node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 519 bytes {0} [built]

Would you please provide us with the source markdown file?

The source markdwon file is created by echo "# Hello VuePress" > README.md on Win10 Powershell

Can you provide the node version?

8.9.3

please try to the remove the double quotes in the README.md file

removing double quotes work!

I was having this problem too, and there were never any double quotes in the README.md file. Like the OP I created the file using Windows Power Shell and the echo command provided at https://vuepress.vuejs.org/guide/getting-started.html What I did to get things to work is not rely on the echo command, and instead create the file directly inside Visual Studio Code, and copy/paste (or type) # Hello VuePress!" into it.

same problem in win10!there are no any bouble quotes in md file.But on Mac, it works well.

Do not use echo command on win10, create the mardown file directly.

image
change the markdown file encoding to utf-8

Looks like echo on Windows creates the file in non utf-8 encoding 🤔

it seems that the echo command doesn't need double quotes at all

echo # Hello VuePress > README.md

Same error for already existing markdown file, but they're already in UTF-8 format (reworking a Metalsmith site) 🤔

just noticed something strange when having a very simple file with just one line:

does not work = ####### Hello
does work again = ###### Hello

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ynnelson picture ynnelson  ·  3Comments

harryhorton picture harryhorton  ·  3Comments

lileiseven picture lileiseven  ·  3Comments

herrbischoff picture herrbischoff  ·  3Comments

AMontagu picture AMontagu  ·  3Comments