nuxt-community / vuetify-module

Vuetify Module for Nuxt 2
Other
629 stars 106 forks source link

Build for production fails on project with typescript (nuxt-ts) #196

Closed CoolONEOfficial closed 4 years ago

CoolONEOfficial commented 4 years ago

Output of yarn build after yarn install:

yarn run v1.19.1
$ nuxt-ts build
ℹ Production build                                                                                                                                                                                                           23:24:29
✔ Builder initialized                                                                                                                                                                                                        23:24:29
✔ Nuxt files generated                                                                                                                                                                                                       23:24:29
ℹ Starting type checking service...                                                                                                                                                                          nuxt:typescript 23:24:31
ℹ Using 1 worker with 2048MB memory limit                                                                                                                                                                    nuxt:typescript 23:24:31

✖ Client
  Compiled with some errors in 21.86s

◯ Modern

◯ Server

Hash: d6f26599ba5232a7fac6
Version: webpack 4.41.2
Time: 21862ms
Built at: 10/15/2019 11:24:53 PM
                  Asset      Size  Chunks               Chunk Names
079590c58c9af55c06bc.js   359 KiB      23  [immutable]  pages/libraries/vacancyprofiles/create
0b73a118aeacef7d7d52.js   447 KiB       7  [immutable]  app
0f6c46ff9048041c59cd.js  18.3 KiB      19  [immutable]  pages/libraries
10168f076cca9b8c7263.js  7.44 KiB      29  [immutable]  pages/tasks
108338276c04d5dc0da0.js  84.4 KiB      26  [immutable]  pages/login
20415893d029a16faffd.js  35.2 KiB      22  [immutable]  pages/libraries/vacancyprofiles
2da076d56e9fe6b512f3.js   123 KiB       1  [immutable]  vendors.pages/jobs/vacancydetails.pages/libraries/linktable.pages/libraries/vacancyprofiles/create.p.ae64b035
3c7045a77715ffec16d5.js   166 KiB       4  [immutable]  pages/jobs/vacancydetails/candidate.pages/jobs/vacancydetails/common.pages/jobs/vacancydetails/motivation
52b149234f7524c7afd7.js  6.58 KiB      28  [immutable]  pages/manager/all
599960acc2962ecaead2.js  79.5 KiB       6  [immutable]  vendors.pages/jobs/vacancyprofile/competence.pages/libraries/vacancyprofiles/create.pages/libraries/.c75df7fa
6d63a4ddd0f7599340c7.js   100 KiB       3  [immutable]  vendors.pages/jobs/vacancydetails/motivation.pages/libraries/competencies.pages/libraries/linktable..fba38cd5
7333188ffa9716f6df6a.js  7.52 KiB       9  [immutable]  pages/experts
7840d4199c13c33b3a9d.js   111 KiB      15  [immutable]  pages/jobs/vacancydetails/motivation
8143c364bfe16b42cf93.js   100 KiB       0  [immutable]  vendors.pages/jobs/vacancydetails/candidate.pages/jobs/vacancydetails/common.pages/jobs/vacancydetai.2ad27cb3
85c40563fa50253d2a91.js   129 KiB      11  [immutable]  pages/jobs
8670747f4034d863038a.js   132 KiB      14  [immutable]  pages/jobs/vacancydetails/common
8d6e24ebebc6d18d4090.js  6.59 KiB      27  [immutable]  pages/manager
8fd5ef7cd5e0b66c5b68.js   359 KiB      25  [immutable]  pages/libraries/vacancyprofiles/view/_id
a08d264db146bccff125.js  91.6 KiB      13  [immutable]  pages/jobs/vacancydetails/candidate
a552076e8fd1c111aea6.js   322 KiB      21  [immutable]  pages/libraries/linktable
aa26c1135fbaaf6daa9a.js  85.2 KiB      32  [immutable]  vendors.pages/login
aa9f997845ea09ab9e4c.js   119 KiB      18  [immutable]  pages/jobs/vacancyprofile/competence
afff3b556b2956f6dc03.js  43.1 KiB      10  [immutable]  pages/index
b99c1028017043cd1fd0.js  11.5 KiB      16  [immutable]  pages/jobs/vacancyprofile
c28789a62dd232e9e5c2.js   111 KiB      24  [immutable]  pages/libraries/vacancyprofiles/list
c86d8b8f1e10241376b2.js  2.78 MiB      31  [immutable]  vendors.app
d1a02ef9e1fabbbf5e2a.js  3.04 KiB      30  [immutable]  runtime
d744bc799e321c88c789.js  11.7 KiB      33  [immutable]  
e0dc968921dab4ef4de2.js  80.6 KiB      12  [immutable]  pages/jobs/vacancydetails
e1438676519b340609e0.js  1.51 MiB       8  [immutable]  commons.app
ea49d9ee75184755cd80.js   201 KiB      20  [immutable]  pages/libraries/competencies
f0d333067900af8e2e24.js   116 KiB      17  [immutable]  pages/jobs/vacancyprofile/common
f2d69b0a06cfce0b5cd7.js   186 KiB       2  [immutable]  vendors.pages/jobs/vacancydetails/candidate.pages/jobs/vacancydetails/common.pages/jobs/vacancydetai.0d032ec2
fb2f698143bb035e5df0.js   156 KiB       5  [immutable]  vendors.pages/jobs/vacancydetails.pages/jobs/vacancyprofile.pages/libraries
      fonts/06147b6.ttf   128 KiB                       
      fonts/0bff33a.ttf   188 KiB                       
    fonts/13ec0eb.woff2  69.6 KiB                       
     fonts/13efe6c.woff  90.7 KiB                       
     fonts/1d65948.woff  84.4 KiB                       
     fonts/313a656.woff  84.5 KiB                       
     fonts/333bae2.woff  96.1 KiB                       
     fonts/35b07eb.woff  83.9 KiB                       
    fonts/4357beb.woff2  68.6 KiB                       
    fonts/44d537a.woff2    74 KiB                       
     fonts/4fe0f73.woff  89.8 KiB                       
      fonts/5063b10.eot   128 KiB                       
     fonts/50d75e4.woff  84.2 KiB                       
    fonts/59eb360.woff2  63.4 KiB                       
    fonts/5b4a33e.woff2  66.7 KiB                       
      fonts/65b286a.ttf  33.3 KiB                       
    fonts/73f0a88.woff2  63.1 KiB                       
     fonts/83e114c.woff    91 KiB                       
     fonts/8a96edb.woff  88.7 KiB                       
      fonts/8e4a6dc.eot   188 KiB                       
    fonts/90d1676.woff2  63.9 KiB                       
    fonts/94008e6.woff2  68.7 KiB                       
    fonts/ad538a6.woff2  61.6 KiB                       
    fonts/b52fac2.woff2  63.2 KiB                       
      fonts/c1a866e.eot  33.6 KiB                       
     fonts/c4f508e.woff  16.4 KiB                       
     fonts/c5e0f14.woff  86.4 KiB                       
     fonts/c73eb1c.woff  83.7 KiB                       
     fonts/cc2fadc.woff  91.8 KiB                       
    fonts/cccc9d2.woff2  73.6 KiB                       
    fonts/d26871e.woff2  62.8 KiB                       
     fonts/d3b4737.woff  82.3 KiB                       
    fonts/e8eaae9.woff2  69.1 KiB                       
     fonts/f5902d5.woff  89.6 KiB                       
    fonts/f5f2566.woff2  13.3 KiB                       
    fonts/f75569f.woff2  70.4 KiB                       
        img/7b9568e.svg   141 KiB                       
        img/a9c4bb7.svg   684 KiB                       
        img/c2801fb.svg   823 KiB                       
Entrypoint app = d1a02ef9e1fabbbf5e2a.js e1438676519b340609e0.js c86d8b8f1e10241376b2.js 0b73a118aeacef7d7d52.js

ERROR in ./node_modules/vuetify/src/styles/main.sass (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-1-3!./node_modules/vuetify/src/styles/main.sass)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Expected identifier.
   ╷
34 │         .v-application .light-blue.#4aa8ee{
   │                                    ^
   ╵
  node_modules/vuetify/src/styles/generic/_colors.scss 34:36  @import
  node_modules/vuetify/src/styles/generic/_index.scss 2:9     @import
  /Users/coolone/PhpstormProjects/team13_jobopen/node_modules/vuetify/src/styles/main.sass 7:9                                                   root stylesheet
 @ ./node_modules/vuetify/src/styles/main.sass 4:14-194
 @ ./node_modules/vuetify/lib/framework.js
 @ ./node_modules/vuetify/lib/index.js
 @ ./.nuxt/vuetify/plugin.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./.nuxt/client.js

 FATAL  Nuxt build error                                                                                                                                                                                                     23:24:53

  at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack-edge/dist/webpack.js:5309:21)
  at process._tickCallback (internal/process/next_tick.js:68:7)

   ╭─────────────────────────────╮
   │                             │
   │   ✖ Nuxt Fatal Error        │
   │                             │
   │   Error: Nuxt build error   │
   │                             │
   ╰─────────────────────────────╯

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

nuxt.config.ts:

import { Configuration } from '@nuxt/types'
import webpack from 'webpack'

const isDev = process.env.NODE_ENV !== 'production'

const config: Configuration = {
  modern: !isDev,
  mode: 'universal',
  serverMiddleware: ['~/servermiddleware/seo.js'],
  /*
   ** Headers of the page
   */
  head: {
    titleTemplate: '%s — JobOpen',
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      {
        hid: 'description',
        name: 'description',
        content: process.env.npm_package_description || ''
      }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: 'favicon.png' },
      {
        rel: 'stylesheet',
        href:
          'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons'
      }
    ]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: false,
  /*
   ** Global CSS
   */
  css: [
    'roboto-fontface/css/roboto/sass/roboto-fontface.scss',
    '@fortawesome/fontawesome-free/css/all.css',
    '@fortawesome/fontawesome-free/scss/fontawesome.scss',
    '~assets/scss/_vuetify_overrides.scss',
    '~assets/scss/_styles.scss',
    '~assets/scss/_vars.scss',
    '~assets/scss/_transitions.scss'
  ],
  /*
   ** Plugins to load before mounting the App
   */
  plugins: [
    '~/plugins/static-mixin.ts',
    '~/plugins/js-mixin.ts',
    '~/plugins/perfect-scrollbar.ts'
  ],
  /*
   ** Nuxt.js modules
   */
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/pwa',
    '@nuxtjs/eslint-module',
    '@nuxtjs/component-cache',
    '@nuxtjs/sitemap',
    [
      'nuxt-validate',
      {
        lang: 'ru'
      }
    ]
  ],
  buildModules: ['@nuxt/typescript-build', '@nuxtjs/vuetify'],
  // Vuetify options
  vuetify: {
    customVariables: ['~/assets/scss/_vuetify.scss']
  },
  /*
   ** Axios module configuration
   ** See https://axios.nuxtjs.org/options
   */
  axios: {},
  /*
   ** Build configuration
   */
  build: {
    /*
     ** You can extend webpack config here
     */
    loaders: {
      sass: {
        sassOptions: {
          indentedSyntax: true
        }
      }
    },
    extend(config, ctx) {
      config.devtool = ctx.isClient ? 'eval-source-map' : 'inline-source-map'
      const plugins = config.plugins
      if (plugins !== undefined) {
        plugins.push(
          new webpack.DefinePlugin({
            STATIC_PATH: JSON.stringify('')
          })
        )
      }
    },
    transpile: ['vue-clamp', 'resize-detector']
  },
  env: {
    serverUrl: 'http://157.245.71.150:8081/'
  },
  typescript: {
    typeCheck: true,
    ignoreNotFoundWarnings: true
  },
  server: {
    port: 3000,
    host: isDev ? 'localhost' : '0.0.0.0'
  }
}

export default config

package.json:

{
  "name": "jobopen",
  "version": "1.0.0",
  "description": "Service for hiring employees",
  "author": "CoolONEOfficial <coolone.official@gmail.com>, monogt",
  "private": true,
  "scripts": {
    "lint": "eslint --ext .ts,.js,.vue --ignore-path .gitignore .",
    "precommit": "yarn lint",
    "dev": "nuxt-ts",
    "build": "nuxt-ts build",
    "start": "DEPLOY_ENV=TEST nuxt-ts start",
    "generate": "DEPLOY_ENV=TEST nuxt-ts generate",
    "test": "jest --updateSnapshot"
  },
  "dependencies": {
    "@fortawesome/fontawesome-free": "^5.11.2",
    "@nuxt/typescript-runtime": "^0.2.1",
    "@nuxtjs/axios": "^5.6.0",
    "@nuxtjs/component-cache": "^1.1.5",
    "@nuxtjs/pwa": "^3.0.0-beta.19",
    "@nuxtjs/sitemap": "^2.0.0",
    "jest-transform-stub": "^2.0.0",
    "lodash.clonedeep": "^4.5.0",
    "lru-cache": "^5.1.1",
    "nuxt-edge": "latest",
    "nuxt-perfect-scrollbar": "^1.0.0",
    "nuxt-property-decorator": "^2.4.0",
    "nuxt-validate": "^1.0.1",
    "perfect-scrollbar": "^1.4.0",
    "pretty-checkbox-vue": "^1.1.9",
    "resize-detector": "^0.2.0",
    "roboto-fontface": "^0.10.0",
    "ts-node": "^8.4.1",
    "vue-clamp": "^0.2.2",
    "vuex-class": "^0.3.2"
  },
  "devDependencies": {
    "@nuxt/typescript-build": "^0.3.1",
    "@nuxtjs/eslint-config": "^1.1.2",
    "@nuxtjs/eslint-config-typescript": "^0.1.3",
    "@nuxtjs/eslint-module": "^1.1.0",
    "@nuxtjs/vuetify": "^1.8.6",
    "@types/jest": "^24.0.19",
    "@typescript-eslint/eslint-plugin": "^2.4.0",
    "@typescript-eslint/parser": "^2.4.0",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-core": "^6.26.3",
    "babel-eslint": "^10.0.3",
    "babel-plugin-transform-imports": "^2.0.0",
    "babel-preset-stage-2": "^6.24.1",
    "deepmerge": "^4.1.1",
    "eslint": "^6.5.1",
    "eslint-config-prettier": "^6.4.0",
    "eslint-config-standard": "^14.1.0",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-jest": "^22.19.0",
    "eslint-plugin-node": "^10.0.0",
    "eslint-plugin-nuxt": "^0.4.3",
    "eslint-plugin-prettier": "^3.1.1",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "eslint-plugin-unicorn": "^12.1.0",
    "eslint-plugin-vue": "^5.2.3",
    "fibers": "^4.0.1",
    "husky": "^3.0.9",
    "jest": "^24.9.0",
    "jest-serializer-vue": "^2.0.2",
    "node-sass": "^4.12.0",
    "prettier": "^1.18.2",
    "sass": "^1.23.0",
    "sass-loader": "^8.0.0",
    "ts-jest": "^24.1.0",
    "vue-jest": "^3.0.5"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "ts",
      "json",
      "vue"
    ],
    "moduleNameMapper": {
      "^@/(.*)$": "<rootDir>/$1",
      "^~/(.*)$": "<rootDir>/$1"
    },
    "transform": {
      ".*\\.(vue)$": "vue-jest",
      "^.+\\.tsx?$": "ts-jest",
      ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
    },
    "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.ts$",
    "snapshotSerializers": [
      "jest-serializer-vue"
    ],
    "coverageDirectory": "./coverage/",
    "collectCoverage": true
  },
  "husky": {
    "hooks": {
      "pre-commit": "git add tests/* & yarn test"
    }
  }
}

tsconfig.json:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "lib": [
      "esnext",
      "esnext.asynciterable",
      "dom"
    ],
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "sourceMap": true,
    "strict": true,
    "noImplicitAny": false,
    "noEmit": true,
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./*"
      ],
      "@/*": [
        "./*"
      ]
    },
    "types": [
      "@types/jest",
      "@types/node",
      "@nuxt/types",
      "@nuxtjs/vuetify"
    ]
  },
  "include": ["**/*.ts", "**/*.vue"],
  "exclude": ["node_modules"]
}

Node v10.16.3 Yarn v1.19.1 Npm 6.9.0

Please help..

kevinmarrec commented 4 years ago

@CoolONEOfficial Please provide a repository instead of files content, cause it's really hard for me to debug this way :)

CoolONEOfficial commented 4 years ago

@kevinmarrec my repo is private, but I create this sandbox with error reproduction: https://codesandbox.io/embed/sdfdsf-wy4py?fontsize=14

kevinmarrec commented 4 years ago

@CoolONEOfficial How can i reproduce the issue on CSB ? I can't clone code from CSB AFAIK, if the issue only happens when using build I need to reproduce it locally

CoolONEOfficial commented 4 years ago

@kevinmarrec i exported repo to archive: sdfdsf.zip

kevinmarrec commented 4 years ago

@CoolONEOfficial I tried your archive and didn't face build issues, consider correctly nuking your node_modules and lock file (yarn.lock).

Also consider upgrading Nuxt TypeScript dependencies, and try the new V2 Alpha of the Nuxt Vuetify module : https://github.com/nuxt-community/vuetify-module/releases/tag/v2.0.0-alpha.0

Sensey19 commented 2 years ago

have the same problem, does anyone know how to fix it?