Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gatsby ^3.0 doesn't display correct compilation error #30046

Closed
anisg opened this issue Mar 5, 2021 · 4 comments · Fixed by #30031
Closed

Gatsby ^3.0 doesn't display correct compilation error #30046

anisg opened this issue Mar 5, 2021 · 4 comments · Fixed by #30031
Labels
topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters) type: bug An issue or pull request relating to a bug in Gatsby

Comments

@anisg
Copy link

anisg commented Mar 5, 2021

Steps to reproduce

  • create a new gatsby project ^3.0
  • add throw "ERROR"; at index.js page (outside react components, just after imports for instance)

Expected result

Gatsby should display the error message "ERROR" and locate the line in the code

Actual result

Gatsby displays the following error:
Error in function EnsureResources.render in ./.cache/ensure-resources.js:86

Environment

System:
OS: macOS 11.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.8.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.5.0 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 89.0.4389.72
Edge: 89.0.774.45
Safari: 14.0.3
npmPackages:
gatsby: 3.0.0 => 3.0.0
gatsby-plugin-crisp-chat: ^3.2.2 => 3.2.2
gatsby-plugin-google-analytics: ^3.0.0 => 3.0.0
gatsby-plugin-gtag: ^1.0.13 => 1.0.13
gatsby-plugin-manifest: ^3.0.0 => 3.0.0
gatsby-plugin-material-ui: ^2.1.10 => 2.1.10
gatsby-plugin-react-helmet: ^4.0.0 => 4.0.0
gatsby-plugin-sharp: ^3.0.0 => 3.0.0
gatsby-plugin-webpack-size: ^1.0.0 => 1.0.0
gatsby-transformer-sharp: ^3.0.0 => 3.0.0

@anisg anisg added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 5, 2021
@bradlocking
Copy link

Got the same issue here with a few client only paths which were otherwise fully functional on v2 before the upgrade.

What's also interesting is that these pages cannot be routed directly, and the page refreshes before attempting to load the content, when I am then faced with the same EnsureResources.render error.

@shennan
Copy link

shennan commented Mar 8, 2021

I'm also getting the same error here and not quite sure where to start in debugging. I've reproduced the error in this repository:

https://github.com/shennan/repro-gatsby-ensure-resources-error

The repository is attempting to use Redoc, which is causing the error. But it's impossible to locate the source of the issue. This issue does not occur in Gatsby 2.X.

As you can see it's a pretty unhelpful error:

Screenshot 2021-03-08 at 10 38 08

Have attempted a gatsby clean as per suggestion and no dice.

@positonic
Copy link

positonic commented Mar 8, 2021

Same here, this is driving me crazy, there's something seriously wrong here. Back to Gatsby 2, and start reading about NextJS.

@bradlocking
Copy link

bradlocking commented Mar 8, 2021

Same here, this is driving me crazy, there's something seriously wrong here. Back to Gatsby 2, and start reading about NextJS.

@jamespfarrell - There's a fix in flight at the moment, which looks promising. Don't give up hope just yet - #30031

Edit: added PR

@LekoArts LekoArts added the topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters) label May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters) type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants