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

Bug: Trouble importing recipes from URL #447

Closed
TomBursch opened this issue May 7, 2024 Discussed in #444 · 0 comments · Fixed by #454
Closed

Bug: Trouble importing recipes from URL #447

TomBursch opened this issue May 7, 2024 Discussed in #444 · 0 comments · Fixed by #454
Labels
bug Something isn't working

Comments

@TomBursch
Copy link
Owner

Discussed in #444

Originally posted by msquibb May 6, 2024
So far, I'm really loving this application, however I seem to be having a bit of an issue importing recipes from URL. I thought it might be related to #424 however I'm not seeing any issues in any of the Docker logs and it looks like the scrape is pulling back a valid JSON document. However, every time I believe that it goes to process the JSON, I get an Uncaught FormatException: undefined error in main.dart.js:5586. I was wondering if it's something that I've done, or something with my setup, or if anyone else has had a similar issue before I went ahead and filed an Issue.

Chrome Console error:

Uncaught FormatException: undefined
    at Object.d (https://my.url.com/main.dart.js:5586:19)
    at Object.fr (https://my.url.com/main.dart.js:8129:9)
    at Object.bKP (https://my.url.com/main.dart.js:45217:11)
    at Object.c_P (https://my.url.com/main.dart.js:45226:38)
    at b7i.oY (https://my.url.com/main.dart.js:163472:9)
    at b7j.$1 (https://my.url.com/main.dart.js:163703:14)
    at aI1.$1 (https://my.url.com/main.dart.js:164195:9)
    at u.Z (https://my.url.com/main.dart.js:59606:20)
    at aYK.hU (https://my.url.com/main.dart.js:164164:16)
    at aYK.b0R (https://my.url.com/main.dart.js:163752:3)

scrape response JSON:

{
    "items": {
        "1 tablespoon Fry Seasoning": null,
        "1 teaspoon Olive Oil": {
            "category": {
                "created_at": 1714927354426,
                "default": true,
                "default_key": "bread",
                "household_id": 1,
                "id": 4,
                "name": "\ud83c\udf5e Baked goods",
                "ordering": 1,
                "updated_at": 1714937417005
            },
            "category_id": 4,
            "created_at": 1714927357063,
            "default": true,
            "default_key": "olive_oil",
            "description": "1.0 teaspoon",
            "household_id": 1,
            "icon": "olive",
            "id": 272,
            "name": "Olive oil",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357063
        },
        "1 teaspoon Vegetable Oil": {
            "category_id": null,
            "created_at": 1714927357064,
            "default": true,
            "default_key": "vegetable_oil",
            "description": "1.0 teaspoon",
            "household_id": 1,
            "icon": null,
            "id": 453,
            "name": "Vegetable oil",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357064
        },
        "10 ounce Chicken Cutlets": null,
        "12 ounce Yukon Gold Potatoes": null,
        "2 tablespoon Butter": {
            "category": {
                "created_at": 1714927354269,
                "default": true,
                "default_key": "dairy",
                "household_id": 1,
                "id": 1,
                "name": "\ud83e\udd5b Dairy",
                "ordering": 6,
                "updated_at": 1714937417005
            },
            "category_id": 1,
            "created_at": 1714927357062,
            "default": true,
            "default_key": "butter",
            "description": "2.0 tablespoon",
            "household_id": 1,
            "icon": "butter",
            "id": 53,
            "name": "Butter",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357062
        },
        "2 tablespoon Mayonnaise": {
            "category_id": null,
            "created_at": 1714927357063,
            "default": true,
            "default_key": "mayonnaise",
            "description": "2.0 tablespoon",
            "household_id": 1,
            "icon": "mustard",
            "id": 244,
            "name": "Mayonnaise",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357063
        },
        "2 tablespoon Sour Cream": {
            "category": {
                "created_at": 1714927354269,
                "default": true,
                "default_key": "dairy",
                "household_id": 1,
                "id": 1,
                "name": "\ud83e\udd5b Dairy",
                "ordering": 6,
                "updated_at": 1714937417005
            },
            "category_id": 1,
            "created_at": 1714927357064,
            "default": true,
            "default_key": "sour_cream",
            "description": "2.0 tablespoon",
            "household_id": 1,
            "icon": null,
            "id": 392,
            "name": "Sour cream",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357064
        },
        "4 ounce Bacon": {
            "category_id": null,
            "created_at": 1714927357061,
            "default": true,
            "default_key": "bacon",
            "description": "4.0 ounce",
            "household_id": 1,
            "icon": "bacon",
            "id": 17,
            "name": "Bacon",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357061
        },
        "8 ounce Broccoli Florets": null,
        "Pepper": {
            "category_id": null,
            "created_at": 1714927357063,
            "default": true,
            "default_key": "pepper",
            "description": " ",
            "household_id": 1,
            "icon": "spice",
            "id": 298,
            "name": "Pepper",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357063
        },
        "Salt": {
            "category_id": null,
            "created_at": 1714927357063,
            "default": true,
            "default_key": "salt",
            "description": " ",
            "household_id": 1,
            "icon": "salt_shaker",
            "id": 361,
            "name": "Salt",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357063
        },
        "\u00bc cup Panko Breadcrumbs": {
            "category_id": null,
            "created_at": 1714957325222,
            "default": false,
            "default_key": null,
            "description": "0.25 cup",
            "household_id": 1,
            "icon": null,
            "id": 489,
            "name": "Panko Breadcrumbs",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714957325222
        },
        "\u00bc ounce Chives": {
            "category": {
                "created_at": 1714927354335,
                "default": true,
                "default_key": "fruits_vegetables",
                "household_id": 1,
                "id": 3,
                "name": "\ud83e\udd6c Fruits and vegetables",
                "ordering": 10,
                "updated_at": 1714937417005
            },
            "category_id": 3,
            "created_at": 1714927357062,
            "default": true,
            "default_key": "chives",
            "description": "0.25 ounce",
            "household_id": 1,
            "icon": null,
            "id": 80,
            "name": "Chives",
            "optional": false,
            "ordering": 0,
            "support": 0.0,
            "updated_at": 1714927357062
        },
        "\u00bd cup Cheddar Cheese": null
    },
    "recipe": {
        "cook_time": 10,
        "created_at": null,
        "description": "\u2022 Adjust rack to top position (top and middle positions for 4 servings) and preheat oven to 425 degrees. Lightly oil a baking sheet. Wash and dry all produce. \u2022 Dice potatoes into \u00bd-inch pieces. Cut broccoli florets into bite-size pieces if necessary. Finely chop chives. \u2022 Place 1 TBSP butter (2 TBSP for 4) in a medium microwave-safe bowl; microwave until melted, 30 seconds. Stir in panko, half the Fry Seasoning, half the cheddar (you\u2019ll use the rest of the seasoning and cheese later), salt, and pepper.\n\u2022 Pat chicken* dry with paper towels; season with remaining Fry Seasoning, salt, and pepper. Place on one side of prepared sheet (for 4 servings, spread out across entire sheet). \u2022 Evenly spread a thin layer of mayonnaise onto tops of chicken (you might not use all the mayo); mound with panko mixture, pressing to adhere (no need to coat the undersides).\n\u2022 Toss broccoli on opposite side of sheet from chicken with a drizzle of olive oil, salt, and pepper. (For 4 servings, add broccoli to a second sheet; roast chicken on top rack and broccoli on middle rack.) \u2022 Roast on top rack until broccoli is browned and tender and chicken is cooked through, 15-20 minutes. TIP: For a deeply golden crust, broil chicken for the last 2-3 minutes.\n\u2022 While chicken and broccoli roast, place potatoes in a large pot with enough salted water to cover by 2 inches. Bring to a boil and cook until tender, 15-20 minutes. \u2022 Reserve \u00bd cup potato cooking liquid, then drain and return potatoes to pot. \u2022 Meanwhile, place bacon* in a large, dry pan over medium-high heat. Cook, turning occasionally, until crispy, 6-10 minutes. \u2022 Turn off heat; transfer to a paper-towel-lined plate. Once bacon is cool enough to handle, roughly chop.\n\u2022 To pot with drained potatoes, add sour cream, remaining cheddar, and 1 TBSP butter (2 TBSP for 4 servings). Mash until smooth and creamy, adding splashes of reserved potato cooking liquid as needed. \u2022 Stir in half the bacon and half the chives. Season with salt and pepper.\n\u2022 Divide chicken, potatoes, and broccoli between plates. Top potatoes with remaining bacon and remaining chives. Serve.",
        "household_id": null,
        "id": null,
        "name": "Crispy Cheddar Chicken with Loaded Bacon Mashed Potatoes & Broccoli",
        "photo": "https://img.hellofresh.com/f_auto,fl_lossy,h_640,q_auto,w_1200/hellofresh_s3/image/60196fc7ff92ca0fa6010c3c-7da1d170.jpg",
        "planned": false,
        "planned_days": [],
        "prep_time": 40,
        "source": "https://www.hellofresh.com/recipes/crispy-cheddar-chicken-60196fc7ff92ca0fa6010c3c",
        "suggestion_rank": null,
        "suggestion_score": null,
        "time": 50,
        "updated_at": null,
        "yields": 2
    }
}
```</div>
@TomBursch TomBursch added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready for Testing
Development

Successfully merging a pull request may close this issue.

1 participant