Skip to content

Error Omit when I tried to build  #11834

@essamamdani

Description

@essamamdani

I am using firebase and Loadable Component in my react app using gatsby. I configured gatsby-node.js for webpack.

exports.onCreateWebpackConfig = ({
  stage,
  rules,
  loaders,
  plugins,
  actions,
}) => {
  actions.setWebpackConfig({
    entry: {
      app: ".cache/production-app"
    },
    output: {
      // e.g app-2e49587d85e03a033f58.js
      filename: `[name]-[contenthash].js`,
      // e.g component---src-blog-2-js-cebc3ae7596cbb5b0951.js
      chunkFilename: `[name]-[contenthash].js`,
      path: `/public`,
      publicPath: `/`
    },
    target: `web`,
    mode: `production`,
    node: {
      ___filename: true
    },
    optimization: {
      runtimeChunk: {
        // e.g webpack-runtime-e402cdceeae5fad2aa61.js
        name: `webpack-runtime`
      },
      splitChunks: false
    },
    plugins: [
      // A custom webpack plugin that implements logic to write out chunk-map.json and webpack.stats.json
      plugins.extractStats(),
    ],
    resolve: {
      alias: {
        components: path.resolve(__dirname, 'src/components'),
        templates: path.resolve(__dirname, 'src/templates'),
        scss: path.resolve(__dirname, 'src/scss'),
      },
    },
  })
}

While building i am getting this error. See below.

error Building static HTML failed

See our docs page on debugging HTML builds for help https://gatsby.app/debug-html

  530 |  * Apply a function to each (key, value) pair in an object or
  531 |  * apply a function to each (index, value) pair in an array
> 532 |  * @param {!(Object|Array)} obj The object or array to iterate over
      |            ^
  533 |  * @param {function(?, ?)} fn The function to apply
  534 |  */
  535 | var each = function (obj, fn) {


  WebpackError: chunk main [initial]
  
  - index.esm.js:532 Parser.pp$4.raise
    [lib]/[@firebase]/database/dist/index.esm.js:532:12
  
  
  
  - static-entry.js:249 Parser.pp$1.parseReturnStatement
    lib/.cache/static-entry.js:249:29
  
  - static-entry.js:101 Parser.pp$1.parseStatement
    lib/.cache/static-entry.js:101:32
  
  - bootstrap:36 Parser.parseStatement
    lib/webpack/bootstrap:36:1
  
  
  - index.esm.js:375 Parser.pp$3.parseFunctionBody
    [lib]/[@firebase]/database/dist/index.esm.js:375:1
  
  
  - auth.esm.js:338 Parser.pp$3.parseExprAtom
    [lib]/[@firebase]/auth/dist/auth.esm.js:338:15
  
  
  - auth.esm.js:201 Parser.pp$3.parseExprSubscripts
    [lib]/[@firebase]/auth/dist/auth.esm.js:201:1
  
  - auth.esm.js:178 Parser.pp$3.parseMaybeUnary
    [lib]/[@firebase]/auth/dist/auth.esm.js:178:18
  
  - auth.esm.js:120 Parser.pp$3.parseExprOps
    [lib]/[@firebase]/auth/dist/auth.esm.js:120:18
  
  - auth.esm.js:103 Parser.pp$3.parseMaybeConditional
    [lib]/[@firebase]/auth/dist/auth.esm.js:103:1
  
  - auth.esm.js:79 Parser.pp$3.parseMaybeAssign
    [lib]/[@firebase]/auth/dist/auth.esm.js:79:1
  
  - index.esm.js:438 Parser.pp$3.parseExprList
    [lib]/[@firebase]/database/dist/index.esm.js:438:1
  
  - auth.esm.js:229 Parser.pp$3.parseSubscripts
    [lib]/[@firebase]/auth/dist/auth.esm.js:229:15
  
  - auth.esm.js:204 Parser.pp$3.parseExprSubscripts
    [lib]/[@firebase]/auth/dist/auth.esm.js:204:18
  
  - auth.esm.js:178 Parser.pp$3.parseMaybeUnary
    [lib]/[@firebase]/auth/dist/auth.esm.js:178:18
  
  - auth.esm.js:120 Parser.pp$3.parseExprOps
    [lib]/[@firebase]/auth/dist/auth.esm.js:120:18
  
  - auth.esm.js:103 Parser.pp$3.parseMaybeConditional
    [lib]/[@firebase]/auth/dist/auth.esm.js:103:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale?Issue that may be closed soon due to the original author not responding any more.status: needs more infoNeeds triaging and reproducible examples or more information to be resolvedstatus: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions