I’ve been working on my project as usual, it was working fine. When I tried to do gatsby build it got this error message:
ReferenceError: Cannot access '_404' before initialization
and
ReferenceError: Cannot access '_mdx_slug_' before initialization
I haven’t added anything that should cause this, though I don’t really understand where the problem is coming from. It seems to refer to the way gatsby builds the pages of the website but I’m not experienced enough to know for sure.
gatsby build full:
success load gatsby config - 0.041s
success load plugins - 0.757s
success onPreInit - 0.029s
success initialize cache - 0.046s
success copy gatsby files - 0.183s
success Compiling Gatsby Functions - 0.185s
success onPreBootstrap - 0.201s
success createSchemaCustomization - 0.011s
success Checking for changed pages - 0.001s
success source and transform nodes - 0.511s
info Writing GraphQL type definitions to /home/daniel_gray/GatsbyProjects/watchsdarot/.cache/schema.gql
warn There are conflicting field types in your data.
If you have explicitly defined a type for those fields, you can safely ignore this warning message.
Otherwise, Gatsby will omit those fields from the GraphQL schema.
If you know all field types in advance, the best strategy is to explicitly define them with the `createTypes` action, and skip inference with the `@dontInfer` directive.
See https://www.gatsbyjs.com/docs/actions/#createTypes
Mdx.frontmatter.EpisodeNum:
- type: number
value: 10
- type: string
value: '09'
Mdx.frontmatter.NumOfEpisodes:
- type: number
value: 10
- type: string
value: '09'
success building schema - 0.469s
success createPages - 0.002s
success createPagesStatefully - 0.336s
info Total nodes: 329, SitePage nodes: 86 (use --verbose for breakdown)
success Checking for changed pages - 0.005s
success Cleaning up stale page-data - 0.010s
success onPreExtractQueries - 0.001s
success extract queries from components - 2.813s
success write out redirect data - 0.010s
success Build manifest and related icons - 0.565s
success onPostBootstrap - 0.609s
info bootstrap finished - 9.239s
success write out requires - 0.048s
success Building production JavaScript and CSS bundles - 8.175s
⠼ Building HTML renderer
[============================] 10.041 s 7/7 100% Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'mini-css-extract-plugin /home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[0].use[1]!/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[0].use[2]!/home/daniel_gray/GatsbyProjects/watchsdarot/src/components/footer.module.css|0|Compilation/modules|/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[0].use[1]!/home/daniel_gray/GatsbyProjects/watchsdar
⠴ Building HTML renderer
[============================] 10.041 s 7/7 100% Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[9].oneOf[0].use[0]!/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[9].oneOf[0].use[1]!/home/daniel_gray/GatsbyProjects/watchsdarot/src/components/foote
success Building HTML renderer - 22.328s
success Execute page configs - 0.028s
success Caching Webpack compilations - 0.002s
success run queries in workers - 0.133s - 78/78 585.57/s
success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 32.550s - 7/7 0.22/s
success Merge worker state - 0.002s
success Rewriting compilation hashes - 0.002s
success Writing page-data.json files to public directory - 0.048s - 79/79 1656.57/s
[ ] 0.000 s 0/85 0% Building static HTML for pages
/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
ReferenceError: Cannot access '_404' before initialization
at Module.default (/home/daniel_gray/GatsbyProjects/watchsdarot/.cache/page-ssr/routes/component---src-pages-404-js.js:182:35)
at RouteHandler.render (/home/daniel_gray/GatsbyProjects/watchsdarot/.cache/page-ssr/routes/webpack:/watchsdarot/.cache/static-entry.js:229:57)
at Ic (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:66:30)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:68:210)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:72:13)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Lc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:77:98)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:69:131)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Ic (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:66:373)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:68:210)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:72:271)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:68:481)
Emitted 'error' event on WritableAsPromise instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at runNextTicks (node:internal/process/task_queues:65:3)
failed Building static HTML for pages - 2.072s
/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
ReferenceError: Cannot access '_mdx_slug_' before initialization
at Module.default (/home/daniel_gray/GatsbyProjects/watchsdarot/.cache/page-ssr/routes/component---src-pages-player-mdx-slug-js.js:278:35)
at RouteHandler.render (/home/daniel_gray/GatsbyProjects/watchsdarot/.cache/page-ssr/routes/webpack:/watchsdarot/.cache/static-entry.js:229:57)
at Ic (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:66:30)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:68:210)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:72:13)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Lc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:77:98)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:69:131)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Ic (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:66:373)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:68:210)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:72:271)
at Z (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:74:89)
at Kc (/home/daniel_gray/GatsbyProjects/watchsdarot/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:68:481)
Emitted 'error' event on WritableAsPromise instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at runNextTicks (node:internal/process/task_queues:65:3)
ERROR #95313
Building static HTML failed
See our docs page for more info on this error: https://gatsby.dev/debug-html
1 | 'use strict';
> 2 | module.exports = function (obj, predicate) {
| ^
3 | var ret = {};
4 | var keys = Object.keys(obj);
5 | var isArr = Array.isArray(predicate);
WebpackError: Worker exited before finishing task
- index.js:2
[watchsdarot]/[filter-obj]/index.js:2:1
- index.js:194
[watchsdarot]/[query-string]/index.js:194:1
- dev-404-page.js:209
watchsdarot/.cache/dev-404-page.js:209:19
Thanks to anyone tried to help.