nuxt / vercel-builder

Vercel Builder for Nuxt
MIT License
643 stars 76 forks source link

Now deployment failing #96

Closed headofthetable closed 5 years ago

headofthetable commented 5 years ago

I am running into deployment issues with the now-builder. I have other projects deployed just fine which is really throwing me off here.

Here is my nuxt.config.js:

const pkg = require('./package')
console.log('ENV', process.env.NODE_ENV)

module.exports = {
  mode: 'universal',
  router: { base: process.env.NODE_ENV === 'production' ? '/nuxt-argon-dashboard-pro/' : '' },
  head: {
    title: pkg.name,
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: pkg.description }
    ],
    link: [
      { rel: 'icon', type: 'image/png', href: 'favicon.png' },
      { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700'},
      { rel: 'stylesheet', href: 'https://use.fontawesome.com/releases/v5.6.3/css/all.css', integrity: "sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/", crossorigin: "anonymous"}
    ]
  },
  loading: { color: '#fff' },
  css: [
    'assets/css/nucleo/css/nucleo.css',
    'assets/sass/argon.scss'
  ],
  plugins: [
    '~/plugins/dashboard/dashboard-plugin',
  ],
  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios',
    '@nuxtjs/pwa',
  ],
  axios: {
    // See https://github.com/nuxt-community/axios-module#options
  },
  build: {
    extend(config, ctx) {
    },
    extractCSS: true,
    babel: {
      plugins: [
        [
          "component",
          {
            "libraryName": "element-ui",
            "styleLibraryName": "theme-chalk"
          }
        ]
      ]
    }
  }
}

Here is my package.json:

{
  "name": "Nuxt-Argon-Dashboard-PRO",
  "version": "1.0.0",
  "description": "Nuxt Dashboard",
  "author": "Wayne",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "dependencies": {
    "@babel/core": "^7.4.5",
    "@fullcalendar/core": "^4.2.0",
    "@fullcalendar/daygrid": "^4.1.0",
    "@fullcalendar/interaction": "^4.1.0",
    "@fullcalendar/timegrid": "^4.1.0",
    "@fullcalendar/vue": "^4.2.2",
    "@nuxtjs/axios": "^5.3.6",
    "@nuxtjs/pwa": "^3.0.0-beta.16",
    "bootstrap": "^4.3.1",
    "chart.js": "^2.8.0",
    "d3": "^5.9.2",
    "datamaps": "^0.5.9",
    "date-fns": "^1.30.1",
    "dropzone": "^5.5.1",
    "element-ui": "^2.9.1",
    "es6-promise": "^4.2.6",
    "flatpickr": "^4.5.7",
    "fuse.js": "^3.4.5",
    "google-maps": "^3.3.0",
    "nouislider": "^13.1.5",
    "nuxt": "^2.8.1",
    "perfect-scrollbar": "^1.4.0",
    "quill": "^1.3.6",
    "sweetalert2": "^8.11.6",
    "vee-validate": "^2.2.8",
    "vue": "^2.6.10",
    "vue-chartjs": "^3.4.2",
    "vue-clipboard2": "^0.3.0",
    "vue-flatpickr-component": "^8.1.2",
    "vue2-transitions": "^0.3.0"
  },
  "devDependencies": {
    "babel-plugin-component": "^1.1.0",
    "cross-env": "^5.2.0",
    "node-sass": "^4.12.0",
    "nodemon": "^1.18.9",
    "sass-loader": "^7.1.0"
  }
}

Here is my now.json:

{
  "version": 2,
  "builds": [
    {
      "src": "nuxt.config.js",
      "use": "@nuxtjs/now-builder",
      "config": {}
    }
  ],
  "routes": [
    {
      "src": "/_nuxt/.+",
      "headers": {
        "cache-control": "s-maxage=31536000"
      }
    },
    {
      "src": "/(.*)",
      "dest": "/"
    }
  ]
}

Lastly the Now logs:

tput: No value for $TERM and no -T specified

   ╭─────────────────────────────╮
   │                             │
   │   ✖ Nuxt Fatal Error        │
   │                             │
   │   Error: Nuxt Build Error   │
   │                             │
   ╰─────────────────────────────╯

{ Error: Command failed: nuxt build --standalone --no-lock --config-file "nuxt.config.js"
null
null
    at makeError (/tmp/252ea55a36e2b1b6/.build-utils/.builder/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/tmp/252ea55a36e2b1b6/.build-utils/.builder/node_modules/execa/index.js:278:16)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
  code: 1,
  stdout: null,
  stderr: null,
  failed: true,
  signal: null,
  cmd: 'nuxt build --standalone --no-lock --config-file "nuxt.config.js"',
  timedOut: false,
  killed: false }

I've seen the execa causing error in a few posts: (https://github.com/nuxt/now-builder/issues/73), (https://github.com/nuxt/now-builder/issues/46) and (https://github.com/nuxt/now-builder/issues/18). It's not a direct dependency of my project so I am not sure what to do here, and I haven't seen a clear answer on what to do in the three aforementioned issues.

Apologies in advance if I am forgetting something obvious. Let me know if I can provide anything else, any help is greatly appreciated!

headofthetable commented 5 years ago

I'm closing this issue because the recent updates to the Now platform had better error logging which allowed be to debug what ended up being a pretty simple bug.

codeofsumit commented 5 years ago

@vipulhpatel can you share the bug?

headofthetable commented 5 years ago

@codeofsumit @unr Sorry for not doing that when I closed the issue, I should've went into further detail and will be mindful of doing that in the future.

For me what was causing that particular failure were simply 2 incorrect import statements in my app (due to typos), so when building the app it failed at those imports because it couldn't find the actual file it was trying to import.

Before Zeit put out the updates to the platform 3 weeks ago, I was getting the above error and couldn't figure out how to debug it which is my I created this issue. However post updates to the platform, the error logging changed and showed me the incorrect import statements.

To be honest given my current breadth of knowledge, I have no idea what had changed behind the scenes that led to the change in error logging. With that being said, after changing those import statements I ran into entirely different issues causing my deployment to fail but they appeared to be unrelated to this issue which is why I closed it. (Now I'm running into a problem where my lambda size is too big)

I'll check to see if I have those deployments still and try to go to into further detail if they're available.