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

× TypeError: Cannot read property 'component---src-templates-home-js' of undefined createComponentUrls D:/projects/someProject/.cache/loader.js:348 #23105

Closed
ArmenMelk opened this issue Apr 14, 2020 · 5 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@ArmenMelk
Copy link

ArmenMelk commented Apr 14, 2020

After add gatsby-plugin-offline plugin I have this issue when do gatsby develop I have got this error messages
×
TypeError: Cannot read property 'component---src-templates-home-js' of undefined
createComponentUrls
D:/projects/myproject/.cache/loader.js:348
345 | }
346 | }
347 |

348 | const createComponentUrls = componentChunkName =>
349 | window.___chunkMapping[componentChunkName].map(
350 | chunk => PATH_PREFIX + chunk
351 | )
View compiled
DevLoader.getResourceURLsForPathname
D:/projects/p7s1p4-4gc-web/.cache/loader.js:303
300 | if (page) {
301 | const pageResources = toPageResources(page.payload)
302 |
303 | return [
304 | ...createComponentUrls(pageResources.page.componentChunkName),
305 | createPageDataUrl(pagePath),
306 | ]
View compiled
getResourceURLsForPathname
D:/projects/p7s1p4-4gc-web/.cache/loader.js:411
408 | enqueue: rawPath => instance.prefetch(rawPath),
409 |
410 | // Real methods
411 | getResourceURLsForPathname: rawPath =>
412 | instance.getResourceURLsForPathname(rawPath),
413 | loadPage: rawPath => instance.loadPage(rawPath),
414 | loadPageSync: rawPath => instance.loadPageSync(rawPath),
View compiled
▶ 2 stack frames were collapsed.
(anonymous function)
D:/projects/p7s1p4-4gc-web/.cache/api-runner-browser.js:35
32 | args.loadPage = loadPage
33 | args.loadPageSync = loadPageSync
34 |
35 | const result = plugin.plugin[api](args, plugin.options)
36 | if (result && argTransform) {
37 | args = argTransform({ args, result, plugin })
38 | }
View compiled
./.cache/api-runner-browser.js.exports.apiRunner
D:/projects/p7s1p4-4gc-web/.cache/api-runner-browser.js:22
19 | }
20 | }
21 |
22 | let results = plugins.map(plugin => {
23 | if (!plugin.plugin[api]) {
24 | return undefined
25 | }
View compiled
onRouteUpdate
D:/projects/p7s1p4-4gc-web/.cache/navigation.js:45
42 |
43 | const onRouteUpdate = (location, prevLocation) => {
44 | if (!maybeRedirect(location.pathname)) {
45 | apiRunner(onRouteUpdate, { location, prevLocation })
46 | // Temp hack while awaiting reach/router#119
47 | window.__navigatingToLink = false
48 | }
View compiled
RouteUpdates.componentDidMount
D:/projects/p7s1p4-4gc-web/.cache/navigation.js:218
215 | }
216 |
217 | componentDidMount() {
218 | onRouteUpdate(this.props.location, null)
219 | }
220 |
221 | componentDidUpdate(prevProps, prevState, shouldFireRouteUpdate) {
View compiled
▶ 18 stack frames were collapsed.
(anonymous function)
D:/projects/p7s1p4-4gc-web/.cache/app.js:67
64 | const preferDefault = m => (m && m.default) || m
65 | let Root = preferDefault(require(./root))
66 | domReady(() => {
67 | renderer(, rootElement, () => {
68 | apiRunner(onInitialClientRender)
69 | })
70 | })

I have checked 'component---src-templates-home-js+somehash.js` is exist in pucblic directory.
I am using windows 10

@ArmenMelk ArmenMelk added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 14, 2020
@ArtsrunKar
Copy link

I also encountered this problem

@ArmenMelk ArmenMelk changed the title × TypeError: Cannot read property 'component---src-templates-home-js' of undefined createComponentUrls D:/projects/p7s1p4-4gc-web/.cache/loader.js:348 × TypeError: Cannot read property 'component---src-templates-home-js' of undefined createComponentUrls D:/projects/someProject/.cache/loader.js:348 Apr 15, 2020
@madalynrose
Copy link
Contributor

Hello and thanks for letting us know about your issue. Is your site repo public? Otherwise, can you create a reproduction so we can help you debug? Thanks!

@ArmenMelk
Copy link
Author

@madalynrose after clean site data from browser it's start work properly

@lannonbr lannonbr added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Apr 20, 2020
@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label May 11, 2020
@github-actions
Copy link

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

4 participants