graphprotocol / graph-client

The Graph library for building GraphQL-based dapps in a decentralized way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid Regular Expression via itty-router

TheDojoSamurai opened this issue · comments

I am getting this error, only when running the Graph-client in a mobile browsers.

Any idea on how to solve this?

2022-11-01 at 11 59 AM

Posted on itty-router as well: kwhitley/itty-router#124

Anyone? this actually makes my ReactApp crash on mobile.

itty-router is used only if you use http handler in your app but I don't think you use it on a FE app. So is it possible to share a reproduction?

My app is setup based on the urql-live-query example

In my App.tsx

import { createClient, Provider } from 'urql'
import * as GraphClient from './graphclient'
import { graphExchange } from '@graphprotocol/client-urql'

const client = createClient({
  url: http://127.0.0.1:8000/subgraphs/name/local-test-graph,
  exchanges: [graphExchange(GraphClient)],
})

Example query call:


const GetUserTokens = `
  query GetUserTokens($accountAddress: String!) 
    @live(interval: 20000) {
      account(id: $accountAddress) {
      nftTokens {
        id
        token
        tokenId
      }
    }
  }
`

const [result, reexecuteQuery] = useQuery({
  query: GetUserTokens,
    variables: {
      accountAddress: address
    },
})

I am getting this error, only when running the Graph-client in a mobile browsers.

Can you please specify the browser and browser version?

Can you please specify the browser and browser version?
@n1ru4l

Both iOS Safari & Chrome iOS throw this error.
Running iOS 16.1, but it also happened before updating to iOS 16.

We're getting this as well - with Next.js, this actually causes all interactivity / JS to fail.

This occurs also on desktop safari - so anything running Webkit. Likely because of regex incompatibility

This was broken from 2.2.10 (works) -> 2.2.11 (does not work)

I am facing the same issue in mobile/desktop safari. I solved this by downgrading the package based on @frankfka's finding. And it works again.

    "@graphprotocol/client-cli": "2.2.10",

@ardatan can you please check if it's relevant with the latest version?

We no longer use itty-router. So this shouldn't exist anymore.