vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.7k stars 4.39k forks source link

Fresh install with vue-resource doesn't build #1432

Open jijoel opened 6 years ago

jijoel commented 6 years ago

Environment

MacOS 10.13.6 node --version // tested with v9.8.0 and v10.8.0 npm --version // 5.6.0 and 6.3.0 vue --version // 3.0.0-rc.10

Steps to reproduce

vue create test2 cd test2/src vue serve

What is expected?

No errors compiling; going to http://localhost:8080 should show the Welcome page.

What is happening?

We get an error compiling:

ERROR  Failed to compile with 1 errors

This dependency was not found:

* @/components/HelloWorld.vue in ../node_modules/babel-loader/lib??ref--12-0!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib??vue-loader-options!./views/Home.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save @/components/HelloWorld.vue

To get around this, I edited views/Home.vue:

// import HelloWorld from '@/components/HelloWorld.vue'
import HelloWorld from '../components/HelloWorld.vue'

When running vue serve again, it compiled, but I got a warning:

WARNING  Compiled with 1 warnings

Module Warning (from ../node_modules/eslint-loader/index.js):
error: Parsing error: Unexpected token import at router.js:20:24:
  18 |       // this generates a separate chunk (about.[hash].js) for this route
  19 |       // which is lazy-loaded when the route is visited.
> 20 |       component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
bzsozsy commented 6 years ago

I have the same issue. Any solution?

sayyes566 commented 5 years ago

use yarn serve

mtbotherd commented 5 years ago

When using yarn serve I get command not found.

sayyes566 commented 5 years ago

@mtbotherd sudo apt-get update && sudo apt-get install yarn. yarn global add @vue/cli

gpgpublickey commented 5 years ago

this is still bugged, some news about it?