Closed Droutin closed 2 years ago
16:23:27 [vite] Internal server error: C:\Projekty\Vengex\ProductivityApp\src\router\index.ts 4:13 error Parsing error: Unexpected token :
router/index.ts
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"; import HomePage from "../views/HomePage.vue"; const routes: Array<RouteRecordRaw> = [ { path: "/", name: "home", component: HomePage, }, ]; const router = createRouter({ history: createWebHashHistory(), routes, }); export default router;
vite.config.js
import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import eslintPlugin from "vite-plugin-eslint"; export default defineConfig({ plugins: [eslintPlugin(), vue()], });
main.ts
import { createApp } from "vue"; import App from "./App.vue"; import Router from "./router"; import "./index.css"; const vue = createApp(App); vue.use(Router); vue.mount("#app");
package.json
{ "name": "productivityapp", "version": "0.0.0", "scripts": { "dev": "vite", "build": "vue-tsc --noEmit && vite build", "preview": "vite preview", "format": "prettier --config .prettierrc . --write" }, "dependencies": { "vue": "^3.2.25", "vue-router": "^4.0.12" }, "devDependencies": { "@vitejs/plugin-vue": "^2.1.0", "autoprefixer": "^10.4.2", "eslint": "^8.7.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-vue": "^8.3.0", "postcss": "^8.4.5", "prettier": "^2.5.1", "tailwindcss": "^3.0.15", "typescript": "^4.5.5", "vite": "^2.7.13", "vite-plugin-eslint": "^1.3.0", "vue-tsc": "^0.31.1" } }
.eslintrc.js
module.exports = { root: true, env: { node: true, }, extends: ["eslint:recommended", "plugin:vue/vue3-essential", "prettier"], parserOptions: { ecmaVersion: 2021, }, rules: {}, };
https://github.com/vuejs/vue-eslint-parser and https://eslint.vuejs.org/user-guide/#usage may help.
Describe the bug 🐛
16:23:27 [vite] Internal server error: C:\Projekty\Vengex\ProductivityApp\src\router\index.ts 4:13 error Parsing error: Unexpected token :
router/index.ts
vite.config.js
main.ts
package.json
.eslintrc.js