Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non deterministic NextJS deploys via now.sh #3254

Closed
1 task done
hanford opened this issue Nov 8, 2017 · 1 comment
Closed
1 task done

non deterministic NextJS deploys via now.sh #3254

hanford opened this issue Nov 8, 2017 · 1 comment

Comments

@hanford
Copy link
Contributor

hanford commented Nov 8, 2017

Hey Zeit / team! First of all, thanks for all of the hard work on NextJS / Now it's a match made and heaven and I'm insanely excited to be able to migrate a large production app over to the platform.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Builds should always be deployable via now and should pass remotely as long as they're passing locally. (considering we're not using any global modules, etc) .. I'm not sure if this is an issue with Next or with Now, but building my app locally works 100% of the time via NODE_ENV=production next build .. which is the step that I believe is failing remotely.

Current Behavior

Sometimes when deploying our app, it will fail intermittently. Upon retrying, it will sometimes work, and other times not .. I'm not sure whether or not it's timing out, or what is actually causing these failures. I just get the obscure "Build Error"

Your Environment

Tech Version
next latest
node 9.0.0
OS OS X High Seirra
browser N/A

This could be related to #1195 .. as I've had to add my own uglifyjs set up to my next.config.js

My next.config.js looks like this:

const variables = require('./components/style-helpers/global-variables.js')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')

module.exports = {
  webpack: function (config, { dev }) {
    console.log(`Environment: ${process.env.NODE_ENV}`)

    if (!dev) {
      console.log('Uglifying JS')
      // remove this once this is resolved: https://github.com/zeit/next.js/issues/1195
      config.plugins = config.plugins.filter(p => p.constructor.name !== 'UglifyJsPlugin')
      config.plugins.push(
        new UglifyJSPlugin({
          parallel: true
        })
      )
    } else {
      // https://webpack.js.org/configuration/devtool/
      config.devtool = 'source-map'
    }

    config.module.rules.push(
      {
        test: /\.(jpg|svg|png|woff)$/,
        loader: 'url-loader?limit=25000'
      },
      {
        test: /\.css$/,
        use: [
          {
            loader: 'emit-file-loader',
            options: {
              name: 'dist/[path][name].[ext]'
            }
          },
          'babel-loader',
          'styled-modules/loader',
          'css-loader?modules',
          {
            loader: 'postcss-loader',
            options: {
              ident: 'postcss',
              plugins: (loader) => [
                require('postcss-custom-properties')({ variables, warnings: false, strict: false }),
                require('postcss-easy-import')({prefix: '_'}),
                require('postcss-cssnext')(),
                require('postcss-nested')()
              ]
            }
          }
        ]
      }
    )

    return config
  }
}

And this has been the intermitten experience I've been having:

I can provide any additional information if I left anything out, but this has been kicking my butt so I'd really love if I could get some other eyes on this!

@timneutkens
Copy link
Member

Closing as talked about with @hanford on dm.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants