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.

useStaticQuery causing failed builds

See original GitHub issue

Description

Failed builds, specifically useStaticQuery is causing a failed json file import error. gatsby develop works just fine though.

Steps to reproduce

Build a project with useStaticQuery with the latest Gatsby.

Expected result

Build should succeed.

Actual result

Note: All failed modules are using useStaticQuery

success open and validate gatsby-configs - 0.053s
success load plugins - 1.963s
success onPreInit - 0.015s
success delete html and css files from previous builds - 0.012s
success initialize cache - 0.007s
success copy gatsby files - 0.075s
success onPreBootstrap - 0.012s
success createSchemaCustomization - 0.005s
success source and transform nodes - 13.019s
success building schema - 0.665s
success createPages - 0.035s
success createPagesStatefully - 0.067s
success onPreExtractQueries - 0.002s
success update schema - 0.042s
success extract queries from components - 0.755s
success write out requires - 0.005s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.104s
success onPostBootstrap - 0.110s
⠀
info bootstrap finished - 21.569s
⠀
failed Building production JavaScript and CSS bundles - 14.010s

 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

Can't resolve '../../public/static/d/1256177919.json' in '/Users/tyler/jolt/toddrantula-dashboard/src/components'

If you're trying to use a package make sure that '../../public/static/d/1256177919.json' is installed. If you're trying to use a local file make sure that the path is correct.

File: src/components/BigEightDashboardv2.js


 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

Can't resolve '../../public/static/d/3943076234.json' in '/Users/tyler/jolt/toddrantula-dashboard/src/components'

If you're trying to use a package make sure that '../../public/static/d/3943076234.json' is installed. If you're trying to use a local file make sure that the path is correct.

File: src/components/departmentList.js


 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

Can't resolve '../../public/static/d/46188684.json' in '/Users/tyler/jolt/toddrantula-dashboard/src/components'

If you're trying to use a package make sure that '../../public/static/d/46188684.json' is installed. If you're trying to use a local file make sure that the path is correct.

File: src/components/saasMetrics.js


 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

Can't resolve '../../public/static/d/856328897.json' in '/Users/tyler/jolt/toddrantula-dashboard/src/components'

If you're trying to use a package make sure that '../../public/static/d/856328897.json' is installed. If you're trying to use a local file make sure that the path is correct.

File: src/components/layout.js

not finished run queries - 14.071s

Environment


  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.61
    Firefox: 75.0
    Safari: 13.1
  npmPackages:
    gatsby: ^2.20.12 => 2.22.11
    gatsby-cli: ^2.12.36 => 2.12.36
    gatsby-image: ^2.2.39 => 2.4.5
    gatsby-plugin-anchor-links: ^1.1.1 => 1.1.1
    gatsby-plugin-manifest: ^2.3.3 => 2.4.9
    gatsby-plugin-material-ui: ^2.1.8 => 2.1.8
    gatsby-plugin-offline: ^3.0.32 => 3.2.7
    gatsby-plugin-react-helmet: ^3.1.21 => 3.3.2
    gatsby-plugin-sharp: ^2.5.3 => 2.6.9
    gatsby-source-filesystem: ^2.2.2 => 2.3.8
    gatsby-source-google-spreadsheet: ^2.0.0 => 2.0.0
    gatsby-transformer-csv: ^2.2.1 => 2.3.2
    gatsby-transformer-sharp: ^2.4.3 => 2.5.3
  npmGlobalPackages:
    gatsby: 2.22.11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
heckchuckmancommented, Aug 15, 2020

+1

I don’t use onPostBuild scripts, either, but I’m getting the same WEBPACK error on components with useStaticQuery

failed Building production JavaScript and CSS bundles - 20.810s

 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

Can't resolve '../../../../public/static/d/1318958187.json' ....
2reactions
AlejoYarcecommented, Aug 10, 2020

I’m having the same issue and I don’t have any onPostBuild scripts

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby useStaticQuery giving causing 'The result of this ...
I'm not facing any issue running the project in Node 12.16.1 . The project builds without issues and I'm able to see the...
Read more >
Setting up a TypeScript and Gatsby project with GraphQL
The useStaticQuery method allows your React components to retrieve data via a GraphQL query that will be parsed, evaluated, and injected into ...
Read more >
Build Time and Client Runtime Data Fetching - Gatsby
This guide demonstrates how to fetch data at both build time and runtime in Gatsby. Most of the techniques outlined are for custom...
Read more >
Troubleshooting Common Errors | GatsbyJS 中文网
Error : ReferenceError: window is not defined when running gatsby build ... Another possibility that could cause this issue is from empty strings...
Read more >
Migrating this Blog to Next.js from Gatsby
What ended being the deal-breaker with Gatsby were build failures and ... the root cause, I made a decision: I'll migrate away from...
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