Gatsby: Error: Chunk.entry was removed. Use hasRuntime()

Created on 5 Sep 2017  ยท  8Comments  ยท  Source: gatsbyjs/gatsby

Struggling to upgrade https://github.com/Spuul/devops-blog/blob/master/package.json

I'm hitting this error:

Error: Chunk.entry was removed. Use hasRuntime()

Any suggestions?

Most helpful comment

I'm seeing this same issue, I am new to Gatsby, just poking around with a project that uses it. Running gatsby develop or gatsby build both will throw this error. I realize this is a long-closed ticket, however, if there is a known resolution for it, I can't find it on this ticket. Can we maybe share the fix? Thanks!

All 8 comments

Are you using Yarn? I ran into this error with 1.x.x, but downgrading to 0.27, even 0.28 was no good

Nope, npm

@KyleAMathews I'm getting this same error. Any tips? I'm using npm + the latest Gatsby. I've tried removing the plugins (helmet, styled-components, netlify) but it doesn't help. Happy to share any other details.

success delete html files from previous builds โ€” 0.015 s
success open and validate gatsby-config.js โ€” 0.010 s
success copy gatsby files โ€” 0.040 s
success onPreBootstrap โ€” 0.028 s
success source and transform nodes โ€” 0.061 s
success building schema โ€” 0.179 s
success createLayouts โ€” 0.115 s
success createPages โ€” 0.021 s
success createPagesStatefully โ€” 0.044 s
success onPreExtractQueries โ€” 0.005 s
success extract queries from components โ€” 0.201 s
success run graphql queries โ€” 0.065 s
success write out page data โ€” 0.019 s
success write out redirect data โ€” 0.003 s
success update schema โ€” 0.123 s
success onPostBootstrap โ€” 0.002 s

info bootstrap finished - 3.256 s

/Users/lachlanjc/src/xyz/node_modules/webpack/lib/Chunk.js:53
                throw new Error("Chunk.entry was removed. Use hasRuntime()");
                ^

Error: Chunk.entry was removed. Use hasRuntime()
  at Chunk.set entry [as entry] (/Users/lachlanjc/src/xyz/node_modules/webpack/lib/Chunk.js:53:9)
  at /Users/lachlanjc/src/xyz/node_modules/extract-text-webpack-plugin/index.js:216:26
  at Array.forEach (native)
  at ExtractTextPlugin. (/Users/lachlanjc/src/xyz/node_modules/extract-text-webpack-plugin/index.js:211:11)
  at Compilation.applyPluginsAsync (/Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/tapable/lib/Tapable.js:71:13)
  at Compilation.seal (/Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/lib/Compilation.js:525:7)
  at Compiler. (/Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/lib/Compiler.js:397:15)
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/tapable/lib/Tapable.js:103:11
  at Compilation. (/Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/lib/Compilation.js:445:10)
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/lib/Compilation.js:417:12
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/lib/Compilation.js:332:10
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/node_modules/async/lib/async.js:52:16
  at done (/Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/node_modules/async/lib/async.js:246:17)
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/node_modules/async/lib/async.js:44:16
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/lib/Compilation.js:332:10
  at /Users/lachlanjc/src/xyz/node_modules/gatsby/node_modules/webpack/node_modules/async/lib/async.js:52:16

I just hit this issue after having done an npm update just now on my project. It was working fine just 2 weeks ago. I'm getting this stacktrace:

success delete html files from previous builds โ€” 0.034 s
success open and validate gatsby-config.js โ€” 0.008 s
info One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's not any stale
data
success copy gatsby files โ€” 0.035 s
success onPreBootstrap โ€” 0.012 s
success source and transform nodes โ€” 0.255 s
success building schema โ€” 0.510 s
success createLayouts โ€” 0.015 s
success createPages โ€” 0.041 s
success createPagesStatefully โ€” 0.026 s
success onPreExtractQueries โ€” 0.002 s
success update schema โ€” 0.247 s
success extract queries from components โ€” 0.633 s
success run graphql queries โ€” 0.242 s
success write out page data โ€” 0.004 s
success write out redirect data โ€” 0.001 s
success onPostBootstrap โ€” 0.002 s

info bootstrap finished - 7.176 s

error UNHANDLED EXCEPTION


  Error: Chunk.entry was removed. Use hasRuntime()

  - Chunk.js:53 Chunk.set entry [as entry]
    [pact.io]/[webpack]/lib/Chunk.js:53:9

  - index.js:216 
    [pact.io]/[extract-text-webpack-plugin]/index.js:216:26

  - Array.forEach

  - index.js:211 ExtractTextPlugin.<anonymous>
    [pact.io]/[extract-text-webpack-plugin]/index.js:211:11

  - Tapable.js:71 Compilation.applyPluginsAsync
    [pact.io]/[gatsby]/[tapable]/lib/Tapable.js:71:13

  - Compilation.js:525 Compilation.seal
    [pact.io]/[gatsby]/[webpack]/lib/Compilation.js:525:7

  - Compiler.js:397 Compiler.<anonymous>
    [pact.io]/[gatsby]/[webpack]/lib/Compiler.js:397:15

  - Tapable.js:103 
    [pact.io]/[gatsby]/[tapable]/lib/Tapable.js:103:11

  - Compilation.js:445 Compilation.<anonymous>
    [pact.io]/[gatsby]/[webpack]/lib/Compilation.js:445:10

  - Compilation.js:417 
    [pact.io]/[gatsby]/[webpack]/lib/Compilation.js:417:12

  - Compilation.js:332 
    [pact.io]/[gatsby]/[webpack]/lib/Compilation.js:332:10

  - async.js:52 
    [pact.io]/[gatsby]/[webpack]/[async]/lib/async.js:52:16

  - async.js:246 done
    [pact.io]/[gatsby]/[webpack]/[async]/lib/async.js:246:17

  - async.js:44 
    [pact.io]/[gatsby]/[webpack]/[async]/lib/async.js:44:16

  - Compilation.js:332 
    [pact.io]/[gatsby]/[webpack]/lib/Compilation.js:332:10

  - async.js:52 
    [pact.io]/[gatsby]/[webpack]/[async]/lib/async.js:52:16

Looks to me like there's a subdependency that's been updated somewhere and causing this issue. I tried checking out an earlier version of my project that built properly and worked (as per TravisCI history), but that one failed when doing it now.

I have to say, this is a very sad development as I just started to trust gatsby again after many issues when trying to start up, getting some cryptic errors, and now it's starting again. _Can I please ask the development team to lock down the dependencies to be extremely specific and forgo to use of ^ and ~ in package.json dependencies so that projects that are dependent on the build working don't go down because of those third part package updates_.

Thanks.

Okay, weird, I just deleted the node_modules directory and redid npm install and everything worked. What the hell? Some dependency didn't update properly? I had actually tried npm install && npm update just to be sure, but nothing worked and now it does :/

@mboudreau NPM by design doesn't allow libraries to lock down dependencies. That's something you should do in your project using either the NPM client package-lock.json or Yarn's yarn.lock.

In general, Yarn seems to be far more reliable.

I had the same error after upgrading yarn from the 1.3.2-> 1.5.1. The downgrade fixed the problem, but of course it's just a temporary workaround.

I'm seeing this same issue, I am new to Gatsby, just poking around with a project that uses it. Running gatsby develop or gatsby build both will throw this error. I realize this is a long-closed ticket, however, if there is a known resolution for it, I can't find it on this ticket. Can we maybe share the fix? Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

totsteps picture totsteps  ยท  3Comments

KyleAMathews picture KyleAMathews  ยท  3Comments

benstr picture benstr  ยท  3Comments

mikestopcontinues picture mikestopcontinues  ยท  3Comments

ghost picture ghost  ยท  3Comments