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

Update gatsby-theme-newrelic to Gatsby 3 #346

Closed
aswanson-nr opened this issue Apr 13, 2021 · 3 comments · Fixed by #355
Closed

Update gatsby-theme-newrelic to Gatsby 3 #346

aswanson-nr opened this issue Apr 13, 2021 · 3 comments · Fixed by #355

Comments

@aswanson-nr
Copy link
Contributor

Summary

Upgrade to Gatsby 3.

Acceptance Criteria

  • gatsby-theme-newrelic can be built and published with Gatsby 3
@aswanson-nr
Copy link
Contributor Author

Broken off from this umbrella issue newrelic/docs-website#1184

@aswanson-nr
Copy link
Contributor Author

I'm currently running into this issue during build:

yarn workspace v1.22.10
yarn run v1.22.10
$ gatsby build
success open and validate gatsby-configs - 0.106s

�[2K�[1A�[2K�[Gwarn Plugin gatsby-plugin-newrelic is not compatible with your gatsby version
3.3.0 - It requires gatsby@^2.0.0

�[2K�[1A�[2K�[Gwarn Plugin gatsby-plugin-newrelic is not compatible with your gatsby version
3.3.0 - It requires gatsby@^2.0.0

�[2K�[1A�[2K�[Gsuccess load plugins - 1.170s

�[2K�[1A�[2K�[Gsuccess onPreInit - 0.055s

�[2K�[1A�[2K�[Gsuccess initialize cache - 0.005s

�[2K�[1A�[2K�[Gsuccess copy gatsby files - 0.144s

�[2K�[1A�[2K�[Gsuccess onPreBootstrap - 0.021s

�[2K�[1A�[2K�[Gsuccess createSchemaCustomization - 0.009s

�[2K�[1A�[2K�[Gsuccess Checking for changed pages - 0.000s

�[2K�[1A�[2K�[Gsuccess source and transform nodes - 0.122s

�[2K�[1A�[2K�[Gwarn Plugin `gatsby-plugin-mdx` has customized the GraphQL type
`MdxFrontmatter`, which has already been defined by the plugin
`@newrelic/gatsby-theme-newrelic`. This could potentially cause conflicts.

�[2K�[1A�[2K�[Gsuccess building schema - 0.408s

�[2K�[1A�[2K�[Ginfo Total nodes: 77, SitePage nodes: 3 (use --verbose for breakdown)

�[2K�[1A�[2K�[Gsuccess createPages - 0.038s

�[2K�[1A�[2K�[Gsuccess Checking for changed pages - 0.000s

�[2K�[1A�[2K�[Gsuccess createPagesStatefully - 0.071s

�[2K�[1A�[2K�[Gsuccess Cleaning up stale page-data - 0.002s

�[2K�[1A�[2K�[Gsuccess update schema - 0.045s

�[2K�[1A�[2K�[Gsuccess onPreExtractQueries - 0.000s

�[2K�[1A�[2K�[Gsuccess extract queries from components - 0.638s

�[2K�[1A�[2K�[Gsuccess write out redirect data - 0.001s

�[2K�[1A�[2K�[Gsuccess onPostBootstrap - 0.003s

�[2K�[1A�[2K�[Ginfo bootstrap finished - 6.675s

�[2K�[1A�[2K�[Gsuccess run static queries - 0.009s - 1/1 109.34/s

�[2K�[1A�[2K�[Gsuccess write out requires - 0.005s

�[2K�[1A�[2K�[Gwarn Should not import the named export 'version' (imported as 'version') from
default-exporting module (only default export is available soon)

�[2K�[1A�[2K�[Gwarn Should not import the named export 'version' (imported as 'version') from
default-exporting module (only default export is available soon)

�[2K�[1A�[2K�[Gsuccess Building production JavaScript and CSS bundles - 23.270s

�[2K�[1A�[2K�[Gsuccess Building HTML renderer - 9.286s

�[2K�[1A�[2K�[Gfailed Building static HTML for pages - 0.365s

�[2K�[1A�[2K�[G
 ERROR #95313

Building static HTML failed

See our docs page for more info on this error: https://gatsby.dev/debug-html


�[2K�[1A�[2K�[G
  73 | 		};
  74 | 	} else {
> 75 | 		ret = Object.create(Object.getPrototypeOf(obj));
     | 		                           ^
  76 | 	}
  77 |
  78 | 	for (const key in obj) { // eslint-disable-line guard-for-in

�[0m
�[0m  �[0m�[97m�[41mWebpackError�[0m�[37m�[41m:�[0m�[37m�[41m �[0m�[97m�[41mTypeError: Cannot convert undefined or null to object�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mindex.js�[0m�[90m:�[0m�[93m75�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90m[demo]/[gatsby-plugin-sitemap]/[pify]/index.js:75:30�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93minternals.js�[0m�[90m:�[0m�[93m24�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90m[demo]/[gatsby-plugin-sitemap]/internals.js:24:36�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mbootstrap�[0m�[90m:�[0m�[93m19�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90mdemo/webpack/bootstrap:19:1�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mgatsby-ssr.js�[0m�[90m:�[0m�[93m11�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90m[demo]/[gatsby-plugin-sitemap]/gatsby-ssr.js:11:18�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mbootstrap�[0m�[90m:�[0m�[93m19�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90mdemo/webpack/bootstrap:19:1�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mapi-runner-ssr.js�[0m�[90m:�[0m�[93m7�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90mdemo/.cache/api-runner-ssr.js:7:15�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mbootstrap�[0m�[90m:�[0m�[93m19�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90mdemo/webpack/bootstrap:19:1�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mstatic-entry.js�[0m�[90m:�[0m�[93m10�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90mdemo/.cache/static-entry.js:10:19�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93minteropRequireWildcard.js�[0m�[90m:�[0m�[93m15�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90m[demo]/[@babel]/runtime/helpers/interopRequireWildcard.js:15:1�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93mwrapNativeSuper.js�[0m�[90m:�[0m�[93m15�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90m[demo]/[@babel]/runtime/helpers/esm/wrapNativeSuper.js:15:1�[0m
�[0m  �[0m
�[0m  �[0m�[90m-�[0m �[0m�[93minteropRequireWildcard.js�[0m�[90m:�[0m�[93m39�[0m�[37m �[0m
�[0m  �[0m  �[0m�[90m[demo]/[@babel]/runtime/helpers/interopRequireWildcard.js:39:1�[0m
�[0m  �[0m
�[0m

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.

Here are the updates made to the webpack config https://github.com/newrelic/gatsby-theme-newrelic/pull/355/files#diff-b861f49a501dec2ab73cd65bc8e66e70ea672bb4b5fb830736f2b7cb9b1c0a89R331

I suspect that the issue is related to the fs module, since the gatsby-plugin-sitemap is using it. That code can be found here https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-sitemap/src/internals.js#L1
It's also worth noting that when the { fallback: { fs: false } } snippet is removed from the webpack config, a different error is generated
Screen Shot 2021-04-16 at 10 27 42 AM

Based on what I've seen so far, this appears to be related to webpack 5 changes, but I have not yet found a solution.

@KyleAMathews
Copy link

I think this is a v3 bug in gatsby-plugin-sitemap — which looks like is fixed in this rewrite (which is about ready to merge) — lemme check internally about getting it merged & published gatsbyjs/gatsby#25670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants