0no-co / wonka

🎩 A tiny but capable push & pull stream library for TypeScript and Flow
MIT License
709 stars 29 forks source link

a is not a function #112

Closed shukii closed 2 years ago

shukii commented 3 years ago

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 commented 3 years ago

@kitten any ideas?

kitten commented 3 years ago

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 😅

shukii commented 2 years ago

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

kitten commented 2 years ago

@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