https://codesandbox.io/s/38n4nxkn76
axios.get("/user.json")
)Complete static files
Error
ERROR / 23:22:09
Error: connect ECONNREFUSED 127.0.0.1:3000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
ERROR connect ECONNREFUSED 127.0.0.1:3000 23:22:09
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
While generating your app no server is running (compared to SSR mode).
What you want to do then is either requiring the json manually (which should be fine) or using a mounted hook (but then the info isn't included in the HTML)
Example (would probably move it to assets):
import data from '~/static/data.json'
export default {
data: () => {
return {
...data,
show: true
}
},
@manniL Wasn't the server running on version 2.1.0 and below?
Most helpful comment
@manniL Wasn't the server running on version 2.1.0 and below?