wonka icon indicating copy to clipboard operation
wonka copied to clipboard

a is not a function

Open shukii opened this issue 4 years ago • 2 comments

I'm running wonka within my application, and occasionally this error pops up and crashes my app running locally:

////node_modules/wonka/dist/wonka.js:608
          c.forEach(function (c) {
            ^
TypeError: a is not a function
    at ////node_modules/@urql/core/src/exchanges/fetch.ts:36:17
    at ////node_modules/wonka/dist/wonka.js:167:16
    at ////node_modules/wonka/dist/wonka.js:482:60
    at ////node_modules/wonka/dist/wonka.js:609:13
    at Array.forEach (<anonymous>)
    at b (////node_modules/wonka/dist/wonka.js:608:13)
    at ////node_modules/wonka/dist/wonka.js:1146:42
    at ////node_modules/wonka/dist/wonka.js:630:31
    at ////node_modules/wonka/dist/wonka.js:180:49
    at h (////node_modules/wonka/dist/wonka.js:163:57)

I saw a similar issue here, however I believe we are using suspense

Any help would be greatly appreciated, as it is causing a bad developer experience

Thanks

shukii avatar Jul 19 '21 14:07 shukii

@kitten any ideas?

shukii avatar Jul 27 '21 15:07 shukii

Without a reproduction there's not much I can do. Unless you're using Wonka independently though, this is more of a question to post ok the urql repo. On the other hand though, the caveat here is that it must be an issue with the build process or repo itself you may have inadvertently caused here.

However, since the stacktrace here doesn't include call sites, code, and isn't pointing at the correct line even, I can't even guess what's going on 😅

kitten avatar Jul 27 '21 15:07 kitten

Any luck with this @kitten? We're still facing it a year later and didn't get the answer from the other repo

shukii avatar Aug 13 '22 16:08 shukii

@shukii Not sure when why this is happening but I'm preparing the repository to move over to TypeScript. urql will move over with the next major bump which will also ditch IE11 support and target ES2015 only.

I've tried this out, and if your environment is set up for it correctly, you should now get full sourcemaps on Wonka. So, potentially, a much easier time debugging.

That said, without a reproduction I can't help you here further myself. This is likely caused by a faulty exchange, faulty usage that shouldn't pass type checks, or an old version/bug that's fixed already 😅

Edit: If you can force a specific version though via Yarn resolutions, or if you simply copy the v6.0.0 source into your node_modules/wonka/ folder, you should already be able to try this out btw

kitten avatar Aug 13 '22 17:08 kitten