urql-devtools: Fails to load with Next JS

When clicking on “URQL” in dev tools I receive these errors (These are emitted in the chrome, not the console):

"TypeError: Cannot read property 'map' of undefined", source: chrome-extension://urql-devtools/panel.js (45493)

"Uncaught TypeError: Cannot read property 'map' of undefined", source: chrome-extension://urql-devtools/panel.js (45543)

"Uncaught (in promise) TypeError: Failed to fetch", source: chrome-extension://urql-devtools/panel.js (46210)

image

import { createClient, dedupExchange, fetchExchange } from 'urql'
import { devtoolsExchange } from '@urql/devtools'
import { cacheExchange } from '@urql/exchange-graphcache'

const IS_PROD = process.env.NODE_ENV === 'production'
const IS_BROWSER = typeof window !== 'undefined'

import 'isomorphic-fetch'

export const createUrqlClient = () => {
  const exchanges = [dedupExchange, cacheExchange(), fetchExchange]

  if (IS_BROWSER) {
    exchanges.push(devtoolsExchange)
  }

  return createClient({
    url: IS_PROD ? `https://x.there.team/api` : `http://localhost:7001/api`,
    exchanges,
  })
}

Debugging aid:

  • React dev tools works fine.
  • window.__urql__.url is set correctly in console.
  • Introspection is enabled, I checked with Apollo Server’s Playground.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I’ve tried this and it seems that the devtools (and exchange) need a new release, when using the one from the chrome store I see your error. When using my local version it just works (hence why I was getting confused)

Thanks for notifying, yes it should be! If anyone else runs into it feel free to ping

@JoviDeCroock Thanks for the quick reply, looking forward to the new releases 🙂 since I’m trying to debug some issues with the graphcache right now it would really come in handy to have the DevTools 😁

I have the same problem, was just about to create an issue when I saw this one.