question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gatsby-plugin-gatsby-cloud/gatsby-node.js": Cannot read property 'RawSource' of undefined

See original GitHub issue

Preliminary Checks

Description

I am using Gatsby Cloud for the first time. The local gatsby build passes successfully, but it fails in gatsby cloud with the following log

17:00:47 PM:
ERROR Error in "/usr/src/app/www/node_modules/gatsby-plugin-gatsby-cloud/gatsby-node.js": Cannot read property 'RawSource' of undefined

17:00:47 PM:
  TypeError: Cannot read property 'RawSource' of undefined

17:00:47 PM:
    [www]/[webpack-assets-manifest]/src/WebpackAssetsManifest.js:17:47

17:00:47 PM:
  - WebpackAssetsManifest.js:17 Object.

17:00:47 PM:
    [www]/[v8-compile-cache]/v8-compile-cache.js:192:30

17:00:47 PM:
  - loader.js:1114 Object.Module._extensions..js

17:00:47 PM:
  - v8-compile-cache.js:192 Module._compile

17:00:47 PM:
    internal/modules/cjs/loader.js:1114:10

17:00:47 PM:
    internal/modules/cjs/loader.js:950:32

17:00:47 PM:
  - loader.js:950 Module.load

17:00:47 PM:
  - loader.js:790 Function.Module._load

17:00:47 PM:
    internal/modules/cjs/loader.js:790:12

17:00:47 PM:
  - loader.js:974 Module.require

17:00:47 PM:
    internal/modules/cjs/loader.js:974:19

17:00:47 PM:
    [www]/[gatsby-plugin-gatsby-cloud]/gatsby-node.js:7:53

17:00:47 PM:
    [www]/[v8-compile-cache]/v8-compile-cache.js:159:20

17:00:47 PM:
  - v8-compile-cache.js:159 require

17:00:47 PM:
  - gatsby-node.js:7 Object.

17:00:47 PM:
  - v8-compile-cache.js:192 Module._compile

17:00:47 PM:
    [www]/[v8-compile-cache]/v8-compile-cache.js:192:30

17:00:47 PM:
  - loader.js:1114 Object.Module._extensions..js

17:00:47 PM:
    internal/modules/cjs/loader.js:1114:10

17:00:47 PM:
    internal/modules/cjs/loader.js:950:32

17:00:47 PM:
  - loader.js:950 Module.load

17:00:47 PM:
  - loader.js:790 Function.Module._load

17:00:47 PM:
    internal/modules/cjs/loader.js:974:19

17:00:47 PM:
  - loader.js:974 Module.require

17:00:47 PM:
    internal/modules/cjs/loader.js:790:12

17:00:47 PM:
    [www]/[v8-compile-cache]/v8-compile-cache.js:159:20

17:00:47 PM:
  - v8-compile-cache.js:159 require

17:00:47 PM:
  - resolve-module-exports.ts:197 resolveModuleExports

17:00:47 PM:
  - validate.ts:431 

17:00:47 PM:
    [www]/[gatsby]/src/bootstrap/resolve-module-exports.ts:197:26

17:00:47 PM:
    [www]/[gatsby]/src/bootstrap/load-plugins/validate.ts:431:31

17:00:47 PM:
not finished open and validate gatsby-configs, load plugins - 0.903s

17:00:48 PM:
ERROR Failed to compile: Error: Exited with code 1

Also, I am not even using gatsby-plugin-gatsby-cloud at all. The link to build log is https://www.gatsbyjs.com/dashboard/c920a613-3f3d-4f94-9268-ac44380fcfb3/sites/f417b027-ec18-4d80-a1cb-11d67ba6d3fc/builds/701c6658-7188-4420-8906-a4694808c9c3/details#rawLogs

I am also using gatsby 4

Reproduction Link

https://github.com/forkfacts/forkfacts/pull/49

Steps to Reproduce

  1. git clone https://github.com/forkfacts/forkfacts 2.cd forkfcats && git checkout -b repro hhimanshu/26_ff_pages
  2. yarn && yarn build …

Expected Result

The build should succeed

Actual Result

The build failed

Environment

System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.4 - ~/.nvm/versions/node/v14.17.4/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.20.3 - ~/.nvm/versions/node/v14.17.4/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Safari: 13.1
  npmPackages:
    gatsby: ^4.1.4 => 4.1.4
    gatsby-plugin-image: ^2.1.2 => 2.1.2
    gatsby-plugin-manifest: ^4.1.3 => 4.1.3
    gatsby-plugin-offline: ^5.1.3 => 5.1.3
    gatsby-plugin-react-helmet: ^5.1.0 => 5.1.0
    gatsby-plugin-sharp: ^4.1.3 => 4.1.3
    gatsby-plugin-svgr: ^3.0.0-beta.0 => 3.0.0-beta.0
    gatsby-source-filesystem: ^4.1.2 => 4.1.2
    gatsby-transformer-json: ^4.1.0 => 4.1.0
    gatsby-transformer-sharp: ^4.1.0 => 4.1.0
  npmGlobalPackages:
    gatsby-cli: 3.14.2

Config Flags

None

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
LekoArtscommented, Nov 16, 2021

In your package.json:

{
  "resolutions": {
      "webpack": "^5.61.0"
   }
}
0reactions
fvieiracommented, Sep 16, 2022

For people using NPM you need to use overrides (introduced in v8.3.0, Node v17.3.0) instead of resolutions , so @LekoArts workaround would be like this instead:

{
  "overrides": {
    "webpack": "^5.61.0"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app + gatsby packages in monorepo won't ...
js": Cannot read property 'RawSource' of undefined TypeError: Cannot read property 'RawSource' of undefined - WebpackAssetsManifest.js:17 Object ...
Read more >
gatsby-plugin-gatsby-cloud
A Gatsby plugin which optimizes working with Gatsby Cloud. Latest version: 5.3.1, last published: 10 days ago.
Read more >
compilation.hooks.normalmoduleloader was moved to ...
js ": Cannot read property 'RawSource' of undefined TypeError: Cannot read property 'RawSource' of undefined - WebpackAssetsManifest.js:17 Object.<anonymous> [ ...
Read more >
gatsby-plugin-gatsby-cloud/gatsby-node.js - Codesti
gatsby-plugin-gatsby-cloud/gatsby-node.js": Cannot read property 'RawSource' of undefined. This issue has been tracked since 2021 ...
Read more >
monorepo中的create-react-app+gatsby包不会同时运行
... /gatsby-plugin-gatsby-cloud/gatsby-node.js": Cannot read property 'RawSource' of undefined TypeError: Cannot read property 'RawSource' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found