0

Ошибка билда, неправильно собирает. В исходном коде все в порядке. До этого работал с проектом на страром маке, перенес проект на новый и он перестал билдить правильно

package.json

{
  "name": "back",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "nuxt": "nuxt",
    "nest": "nest start",
    "dev": "cross-env IS_NUXT_ENABLED=true nodemon",
    "dev:client": "nuxt",
    "dev:server": "nodemon",
    "build": "run-s clean:dist compile:server compile:client client:generate copy:.nuxt copy:client copy:config",
    "clean:dist": "rimraf dist",
    "compile:server": "tsc -p tsconfig.build.json",
    "compile:client": "cross-env mode=production nuxt build",
    "client:generate": "cross-env mode=production nuxt generate",
    "copy:client": "copyfiles -a \\\"client/**/*\\\" dist",
    "copy:.nuxt": "copyfiles -a \".nuxt/**/*\" dist",
    "copy:config": "copyfiles nuxt.config.ts package.json package-lock.json dist"
  },
  "dependencies": {
    "@babel/preset-env": "7.12.17",
    "@nestjs/common": "^8.0.6",
    "@nestjs/config": "^1.0.1",
    "@nestjs/core": "^8.0.6",
    "@nestjs/jwt": "^8.0.0",
    "@nestjs/mongoose": "^8.0.1",
    "@nestjs/platform-express": "^8.0.6",
    "@nestjs/serve-static": "^2.2.2",
    "@nestjs/swagger": "^5.0.9",
    "@nuxt/content": "^1.5.0",
    "@nuxt/http": "latest",
    "@nuxt/typescript-runtime": "^1.0.0",
    "@nuxtjs/axios": "^5.12.0",
    "@nuxtjs/pwa": "^3.0.0-beta.20",
    "@types/bcryptjs": "^2.4.2",
    "bcryptjs": "^2.4.2",
    "bootstrap": "^4.6.0",
    "bootstrap-colorpicker": "^3.4.0",
    "chart.js": "^2.7.1",
    "cookie-parser": "^1.4.5",
    "cookie-universal-nuxt": "^2.1.5",
    "element-ui": "^2.11.1",
    "es6-promise": "^4.1.1",
    "express-list-routes": "^1.1.3",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^6.0.1",
    "nuxt": "^2.14.0",
    "nuxt-i18n": "^6.1.0",
    "perfect-scrollbar": "^1.5.2",
    "puppeteer": "^10.2.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^6.5.4",
    "swagger-ui-express": "^4.1.6",
    "v-click-outside": "^3.1.2",
    "vue-chartjs": "^3.4.0",
    "vue2-transitions": "^0.2.3"
  },
  "devDependencies": {
    "@aceforth/nuxt-netlify": "^1.1.0",
    "@nestjs/cli": "^7.0.0",
    "@nestjs/schematics": "^7.0.0",
    "@nestjs/testing": "^7.0.0",
    "@nuxt/types": "^2.14.0",
    "@nuxt/typescript-build": "^2.0.2",
    "@types/cookie-parser": "^1.4.2",
    "@types/express": "^4.17.3",
    "@types/node": "^13.9.1",
    "@types/puppeteer": "^5.4.4",
    "@types/supertest": "^2.0.8",
    "@vue/test-utils": "^1.0.3",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "^26.1.0",
    "copyfiles": "^2.3.0",
    "cross-env": "^7.0.2",
    "fibers": "^5.0.0",
    "husky": "^4.2.5",
    "lint-staged": "^10.2.11",
    "node-sass": "^4.12.0",
    "nodemon": "^2.0.4",
    "npm-run-all": "^4.1.5",
    "sass": "^1.38.1",
    "sass-loader": "^7.3.1",
    "supertest": "^4.0.2",
    "ts-jest": "^26.1.3",
    "ts-loader": "^6.2.1",
    "ts-node": "9.0.0",
    "tsconfig-paths": "^3.9.0",
    "typescript": "^3.7.4",
    "vue-jest": "^3.0.4"
  }
}

nuxt.config.ts

import {NuxtConfig} from '@nuxt/types'
import {resolve} from "url";

const pkg = require('./package.json')
const config: NuxtConfig = {
  // Disabled nuxt telemetry
  telemetry: false,
  /*
   ** Nuxt rendering mode
   ** See https://nuxtjs.org/api/configuration-mode
   */
  mode: 'universal',
  // base nuxt src dir
  srcDir: './client',
  /*
   ** Nuxt target
   ** See https://nuxtjs.org/api/configuration-target
   */
  target: 'server',
  /*
   ** Headers of the page
   ** See https://nuxtjs.org/api/configuration-head
   */
  head: {
    title: 'Statistic',
    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.ico'},
      { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800'},
      { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css'}
    ],
    bodyAttrs: {
      class: '' // Add `white-content` class here to enable "white" mode.
    }
  },
  router: {
    linkExactActiveClass: 'active'
  },
  /*
   ** Global CSS
   */
  css: [
    '@/assets/scss/index.scss',
    '@/assets/css/demo.css',
    '@/assets/css/nucleo-icons.css'
  ],
  /*
   ** Plugins to load before mounting the App
   ** https://nuxtjs.org/guide/plugins
   */
  plugins: [
    `@/plugins/dashboard-plugin.js`
  ],
  /*
   ** Auto import components
   ** See https://nuxtjs.org/api/configuration-components
   */
  components: true,
  /*
   ** Nuxt.js dev-modules
   */
  buildModules: [
    '@nuxt/typescript-build',
  ],
  netlify: {
    headers: {
      '/*': [
        'Access-Control-Allow-Origin: *',
        `X-Build: ${pkg.version}`
      ],
      '/favicon.ico': [
        'Cache-Control: public, max-age=86400'
      ]
    }
  },
  /*
   ** Nuxt.js modules
   */
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/pwa',
    '@nuxt/content',
    'cookie-universal-nuxt'
  ],
  publicRuntimeConfig: {
    axios: {
      baseURL: 'http://localhost:3000/api'
    }
  },
  /*
   ** Axios module configuration
   ** See https://axios.nuxtjs.org/options
   */
  axios: {},
  /*
   ** Content module configuration
   ** See https://content.nuxtjs.org/configuration
   */
  content: {},

  loading: { color: '#fff' },

  /*
   ** Build configuration
   ** See https://nuxtjs.org/api/configuration-build/
   */
  build: {
    babel: {
      presets(env, [ preset, options ]) {
        return [
          [ "@babel/preset-env", options ]
        ]
      }
    },
  },
  alias: {
    '~': resolve(__dirname, './client'),
    "~~/*": resolve(__dirname, './client'),
    "@@/*": resolve(__dirname, './client')
  }
}

export default config

 ERROR  Failed to compile with 1 errors                                                                                                                               friendly-errors 11:17:16


 ERROR  in ./.nuxt/components/index.js                                                                                                                                friendly-errors 11:17:16

Syntax Error: Unexpected token (13:21)                                                                                                                                friendly-errors 11:17:16

  11 | export { default as LoadingPanel } from '../../client/components/LoadingPanel.vue'
  12 | export { default as Modal } from '../../client/components/Modal.vue'
> 13 | export { default as  } from '../../client/components/index.js'
     |                      ^
  14 | export { default as Breadcrumb } from '../../client/components/Breadcrumb/Breadcrumb.vue'
  15 | export { default as BreadcrumbItem } from '../../client/components/Breadcrumb/BreadcrumbItem.vue'
  16 | export { default as BreadcrumbRouteBreadcrumb } from '../../client/components/Breadcrumb/RouteBreadcrumb.vue'

                                                                                                                                                                      friendly-errors 11:17:16
 @ ./.nuxt/components/plugin.js 2:0-38 4:17-27 5:22-32 6:31-41
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

В чем может быть проблема???

6
  • А ошибку мы должны угадать или посмотреть в хрустальном шаре?
    – Alexey Ten
    Commented 12 сент. 2021 в 9:41
  • Sorry, this part of SO is for questions in Russian. Please, use stackoverflow.com for questions in English or translate your question. Commented 12 сент. 2021 в 10:18
  • Так Вам указывается, в чём ошибка... Перекомпилируйте проект, переустановите пакеты. Обычно помогает. Commented 12 сент. 2021 в 11:12
  • Устанавливал через yarn & npm, все равно ошибка есть.
    – Mr. Byte
    Commented 12 сент. 2021 в 11:29
  • вам ведь пишут в чём проблема, export { default as ТУТ-ОЖИДАЕТСЯ-ЧТОТО } from Commented 12 сент. 2021 в 12:03

0

Ваш ответ

Нажимая «Отправить ответ», вы соглашаетесь с условиями пользования и подтверждаете, что прочитали политику конфиденциальности.

Посмотрите другие вопросы с метками или задайте свой вопрос.