Vue-cli: user pages but got an error info?t= 404 not found and I fix it

Created on 30 May 2018  路  8Comments  路  Source: vuejs/vue-cli

Version

3.0.0-beta.13

Reproduction link

https://github.com/CXY037/vue-cli-pages-bug

Steps to reproduce

vue.config.js 's pages
const pages = {}
glob.sync('./src/pages/**/app.js').forEach(path => {
const chunk = path.split('./src/pages/')[1].split('/app.js')[0]
const page = {}
page.entry = path
page.template = resolve(path.replace(/app.js/g, 'app.html'))
// page.filename = ${chunk}.html
pages[chunk] = page
})

What is expected?

pages normal

What is actually happening?

dub dir page got
http://localhost:8081/sockjs-node/info?t=1527653005031
404 not found

Most helpful comment

Oh. Then our docs are out of sync :-P

All 8 comments

the fixed method is
modify
@vue/cli-service/lib/commands/server.js
change require.resolve(webpack-dev-server/client),
to require.resolve('webpack-dev-server/client') + '?http://localhost:8081',

vue-cli 3 doesn'thave a pages option so I have no idea what this is about?

Oh. Then our docs are out of sync :-P

@LinusBorg I read the code and find the multipages-app support hah

@Akryum you can modify the code and it's working fine

This is fixed by #1405

Was this page helpful?
0 / 5 - 0 ratings