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.

Problem with fragments

See original GitHub issue

I probably have done something wrong, but I can’t see what.

The error I’m seeing is:

find frag Likes_3K7mRP Likes
Error: Fragment doesn't exist in its own document?!
    at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:77683:55
    at step (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:124:23)
    at Object.next (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:105:53)
    at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:98:71
    at new Promise (<anonymous>)
    at __awaiter$1 (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:94:12)
    at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:77627:58
    at Array.map (<anonymous>)
    at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:77627:30
    at step (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:124:23)

I added the ‘find frag’ log statement to figure out what’s in there:

    matchingFragment = fragments.find(function (fragment) { 
      console.log('find frag', fragment.name.value, name)
      return fragment.name.value === name; });
    if (!matchingFragment) {
        throw new Error("Fragment doesn't exist in its own document?!");
    }

The setup for my fragment is:

	import { fragment, mutation, graphql, Likes } from '$houdini';

	export let id;
	export let likes: Likes;

	const data = fragment(
		graphql`
			fragment Likes on media @arguments(userId: { type: "uuid!" }) {
				likes(where: { user_id: { _eq: $userId } }) {
					media_id
				}
			}
		`,
		likes
	);

And the ‘parent’ is:

const { data, loading, error } = query<AllTracks>(graphql`
		query AllTracks($userId: uuid!) {
			media(order_by: [{ likes_aggregate: { count: desc } }, { title: asc }]) {
				title
				bpm
				data_folder
				id
				recorded_date
				stereo_mix
				tracks
				likes_aggregate {
					aggregate {
						count
					}
				}
				...Likes @with(userId: $userId)
			}
		}
	`);

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AlecAivaziscommented, Oct 7, 2021

Ah damn! I have a hunch what’s causing this, I’ll try to get something out ASAP. Thanks for reporting it

0reactions
AlecAivaziscommented, Nov 8, 2021

Going to close this since its gone stale. If you have a reproducible error I’d love to take a closer look

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Common Mistakes Easily Made with Android Fragment
Mistake makes when working in Fragment sometimes are hard to debug, as it is not always replicable due to its complicated lifecycle event....
Read more >
Fragments: The Solution to All of Android's Problems
A comprehensive look at the state of Fragments in 2017; solution to (and cause of) all of Android's problems.
Read more >
Debug your fragments | Android Developers
This guide covers tools that you can use to debug your fragments. ... log messages can help you troubleshoot issues with your fragments....
Read more >
Advocating Against Android Fragments | Square Corner Blog
Fragments are view controllers; they hold decoupled chunks of business logic that can be tested. The fragment API provides backstack management ...
Read more >
android - AndroidStudio - Error in Fragments - Stack Overflow
AndroidStudio - Error in Fragments ; xmlns:android · "http://schemas.android.com/apk/res/android" ; xmlns:tools · "http://schemas.android.com/tools" ...
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