gatsby: Webpack Error, static-entry: transpile
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`
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (4 by maintainers)
Hi I have got a simple solution for this error which is replacing “gatsby-config.js” file name to “gatsby.config.js”. Try this 😃
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.
I finally found the issue. This is caused by the presence of
.babelrcthat might be there in any of the nearest ancestor folders. Please check the parent folder for the presence of.babelrcand 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.
Mine looks a bit different, probably because of the newer gatsby version:
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