Gatsby: Webpack Error, static-entry: transpile

Created on 12 Oct 2017  Â·  23Comments  Â·  Source: gatsbyjs/gatsby

Hi there,
Whenever I try to build, I am getting this error. Can anyone please tell me whats it related to and how can I get rid of it.

`

1 | import React from "react"
| ^
2 | import { renderToString, renderToStaticMarkup } from "react-dom/server"
3 | import { StaticRouter, Route, withRouter } from "react-router-dom"
4 | import { kebabCase, get, merge, isArray, isString } from "lodash"

WebpackError:

  • static-entry.js:1 transpile
    .cache/static-entry.js:1:1

  • static-entry.js:7
    .cache/static-entry.js:7:1

  • React.js:82 FSReqWrap.readFileAfterOpen [as oncomplete]
    ~/react/lib/React.js:82:1`

Most helpful comment

Hi,
I am also getting the same error while building. can anyone help me out to get rid of it.
Yeah it is happening in default starter only.

All 23 comments

Does this happen in the default starter?

Hi,
I am also getting the same error while building. can anyone help me out to get rid of it.
Yeah it is happening in default starter only.

@yasserzubair @halloween603 Did you find the cause / solution for this?

I'm getting the same error out of nowhere. Any idea what It would be?

I also got this error. Is there any solution?

Hi,

have this same error, can't build or deploy. Any solution for this?

@yasserzubair Can you try creating a new app in the home (~/) folder? I could reproduce the issue and looking into what might have caused this.

I finally found the issue. This is caused by the presence of .babelrc that might be there in any of the nearest ancestor folders. Please check the parent folder for the presence of .babelrc and remove it. Keep checking the parent directories till you find that file and remove it. Hope this helps.

Now, why this happens? I have no idea. I'll need to delve deeper into webpack.

I have no .babelrc in any directory in my project. For me, it might from something else?

@arnondora Are you also getting "Webpack Error"?

Yes, I also got webpack error. Now, the problem is gone but I don’t know why. I just re-build project again and again.

On 13 Jan BE 2561, at 03:47, Praveen notifications@github.com wrote:

@arnondora Are you also getting "Webpack Error"?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Having this same issue as well. Anyone have any ideas?

Facing this same issue, no .babelrc here.

Mine looks a bit different, probably because of the newer gatsby version:

1 | import React from "react"
    | ^
  2 | import { renderToStaticMarkup } from "react-dom/server"
  3 | import { merge } from "lodash"
  4 | import apiRunner from "./api-runner-ssr"


  WebpackError:

  - develop-static-entry.js:1 transpile
    .cache/develop-static-entry.js:1:1

  - develop-static-entry.js:7
    .cache/develop-static-entry.js:7:1

Sometime I just remove some of graphql query in the gatsby-node.js And build, it worked. Then I just add the part that has removed and build again, it also work. I still don’t know why this problem happened.

In my case it ended up being a syntax error that eslint wasn't alerting me to for some reason. I had a missing ] in my typography.js. Run your code through eslint and make sure there are no errors

Mine also ended up being a syntax error.

same for me.. it was a syntax error.

Same here -- syntax error. Specifically, I had some JSON-LD structured data I was outputting inside of ` tags. Just missing a comma, but wasn't notified clear of that in my terminal.

In case could be useful for someone having this issue, in my case was using yeld inside a function not declared as _generator_ so without *, adding it solved this issue.

Hi I have got a simple solution for this error which is replacing "gatsby-config.js" file name to "gatsby.config.js". Try this :)

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

I got this error then updating gatsby from 2.5.3 to 2.10.0

Was this page helpful?
0 / 5 - 0 ratings