gatsby: Gatsby build Building production JavaScript and CSS bundles step never complete

Description

Describe the issue that you’re seeing.

Gatsby build Building production JavaScript and CSS bundles step never completes. Gatsby develop works.

Steps to reproduce

Clear steps describing how to reproduce the issue.

$ gatsby build

Expected result

What should happen?

successful build:

success Building production JavaScript and CSS bundles — 58.017 s
success Building static HTML for pages — 13.414 s — 18/18 6.34 pages/second
info Done building in 180.627 sec

Actual result

What happened.

this never completes and there are no error messages whatsoever

Building production JavaScript and CSS bundles

Environment

  System:
    OS: Linux 4.4 Ubuntu 18.04 LTS (Bionic Beaver)
    CPU: x64        Intel(R) Core(TM) i7-3687U CPU @ 2.10GHz
    Shell: 4.4.19 - /bin/bash
  Binaries:
    Node: 10.6.0 - ~/n/bin/node
    Yarn: 1.9.4 - ~/n/bin/yarn
    npm: 6.3.0 - ~/n/bin/npm
  npmGlobalPackages:
    gatsby-cli: 2.0.0-beta.7

File contents (if changed)

gatsby-config.js:

module.exports = {
  siteMetadata: {
    title: `Blog App`,
    siteStories: {
      title: `Stories of Our Time`,
    },
    siteEvents: {
      title: `Pandas Eating Lots`,
    },
    siteAbout: {
      title: `About CSS Modules`,
    },
  },
  plugins: [
    {
      resolve: 'gatsby-source-airtable',
      options: {
        apiKey: 'keyT4kaMtXoFjjGqh',
        baseId: 'app7Dd4JJ1IwhOgHS',
        tableName: 'cms',
        tableView: 'published',
        queryName: ''
      }
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `src`,
        path: `${__dirname}/src/`,
      },
    },
    `gatsby-transformer-remark`,
    `gatsby-plugin-emotion`,
    `gatsby-plugin-react-helmet`,
    {
    resolve: `gatsby-plugin-typography`,
    options: {pathToConfigModule: `src/utils/typography.js`},
    },
  ],
}

package.json:

{
  "name": "blog",
  "description": "Blog Application",
  "version": "0.1.0",
  "dependencies": {
    "emotion": "^9.2.6",
    "emotion-server": "^9.2.6",
    "gatsby": "^2.0.0-beta.67",
    "gatsby-plugin-emotion": "^2.0.0-beta.3",
    "gatsby-plugin-react-helmet": "next",
    "gatsby-plugin-typography": "^2.2.0-beta.3",
    "gatsby-source-filesystem": "^2.0.1-beta.10",
    "gatsby-transformer-remark": "^2.1.1-beta.5",
    "react": "^16.4.1",
    "react-dom": "^16.4.1",
    "react-emotion": "^9.2.6",
    "react-helmet": "^5.2.0",
    "react-typography": "^0.16.13",
    "remark-html": "^7.0.0",
    "remark-react": "^4.0.3",
    "typography": "^0.16.17",
    "typography-theme-lincoln": "^0.15.11",
    "unified": "^7.0.0"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "develop": "gatsby develop",
    "format": "prettier --write 'src/**/*.js'",
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "gatsby build"
  },
  "devDependencies": {
    "prettier": "^1.13.7"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  }
}

gatsby-node.js:

const path = require(`path`)
const { createFilePath } = require(`gatsby-source-filesystem`)

exports.onCreateNode = ({ node, getNode, actions }) => {
  const { createNodeField } = actions
  if (node.internal.type === `MarkdownRemark`) {
    const slug = createFilePath({ node, getNode, basePath: `contents` })
    createNodeField({
      node,
      name: `slug`,
      value: slug,
    })
  }
}

exports.createPages = ({ graphql, actions }) => {
  const { createPage } = actions
  return new Promise((resolve, reject) => {
    graphql(`
      {
        allAirtable {
          edges {
            node {
              slug
            }
          }
        }
        allMarkdownRemark {
          edges {
            node {
              fields {
                slug
              }
            }
          }
        }
      }
    `).then(result => {
      result.data.allMarkdownRemark.edges.forEach(({ node }) => {
        createPage({
          path: `/events${node.fields.slug}`,
          component: path.resolve(`./src/templates/blog-post.js`),
          context: {
            // Data passed to context is available
            // in page queries as GraphQL variables.
            slug: node.fields.slug,
          },
        })
      })
      result.data.allAirtable.edges.forEach(({ node }) => {
        createPage({
          path: `/stories${node.slug}`,
          component: path.resolve(`./src/templates/air-post.js`),
          context: {
            slug: node.slug
          }
        })
      })
      resolve()
    })
  })
}

gatsby-browser.js: N/A gatsby-ssr.js: N/A

air-post.js:

import React from "react"
import unified from 'unified'
import markdown from 'remark-parse'
import html from 'remark-html'
import { graphql } from "gatsby"
import Layout from "../components/layout-stories"

export default ({ data }) => {
  // console.log(data)
  return (
    <Layout>
      <div>
        <h1>{data.airtable.title}</h1>
        <h5>{data.airtable.published_date}</h5>
        <h5>Written by {data.airtable.author}</h5>
        <img
          src={data.airtable.cover[0].url}
          style={{
            display: 'block',
            marginBottom: '1rem',
            marginTop: '1rem',
            width: '100%',
            height: 'auto'
          }}
          alt=""
        />
        <div
          dangerouslySetInnerHTML={{
            __html: unified()
              .use(markdown)
              .use(html)
              .processSync(data.airtable.story)
          }}
        />
      </div>
    </Layout>
  )
}

export const query = graphql`
  query($slug: String!) {
    airtable(slug: { eq: $slug }) {
      id
      slug
      title
      cover {
        id
        url
      }
      story
      status
      published_date(formatString: "DD MMMM, YYYY")
      author
    }
  }
`

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 36 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Oh @gatsbybot , thank you for closing a real issue just because nobody is rude enough to bump it every week.

Updating Windows did unfortunately not solve it for me. I have the same problem, the build process is still stuck at ⡀ Building production JavaScript and CSS bundles on Windows 10 WSL Ubuntu 16.

I’ve suffered from this, for past weeks. It was kinda on and off situation. It doesn’t happen on a new, fresh project, but my current one has grown a little. But just today I came to conclusion that setting my laptop to best performance, particularly on battery SOLVED IT.

TLDR: Your PC is weak for the bundles, boost it or get a better one.

Deleting ./cache as well as /public solved this for me

Hello,

Any news on this issue ? I’m running WSL on Windows 10 1809 and local builds always hang at Building production JavaScript and CSS bundles

Is there any way I can enable a “debug mode” so that at least I could see which command fails ?

Edit: the latest version of gatsby seems to work (2.0.91)