Skip to content

Modelviewer throws SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data #2276

Open
@nhm1990

Description

@nhm1990

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.4.7

What version of Remix are you using?

2.9.2

Steps to Reproduce

  1. Upload .glb model to product.
  2. Load model (model3d) via product/GraphQL
  3. What I had also to do is added scriptSrc: ["'self'", 'https://unpkg.com', ...] to "createContentSecurityPolicy"
  4. initialize model with hydrogen component

Expected Behavior

Model will be rendered and can be loaded/viewed.

Actual Behavior

Just preview image is shown and error "JSON.parse: unexpected character at line 1 column 1 of the JSON data" is thrown.
(See screenshot)

  • I was also able to reproduce it in older hydrogen versions.
  • #UPDATE: With sample model provided by shopify it's working. My model is also working with the generic shopify online-store template, but not with hydrogen.

model viewer issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingSEV-4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions