Giter Club home page Giter Club logo

Comments (13)

filip-lipinski-tsh avatar filip-lipinski-tsh commented on September 28, 2024 4

This issue still exist :< It is a pity that this continues

from rematch.

Javi avatar Javi commented on September 28, 2024 1

Test looks good, though I'll see how I can extract the problem from my (admittedly large) repo onto a reproducible one.

from rematch.

hasan-aa avatar hasan-aa commented on September 28, 2024 1

Hello,
I've come across another issue using immer plugin which is fixed in the lates version. So I'm stuck between these 2 issues.

I've extracted a reproduction from my project here:
https://codesandbox.io/s/rematch-typescript-bug-b47q22?file=/src/App.tsx

Hope this helps fixing this one.

from rematch.

semoal avatar semoal commented on September 28, 2024

We'll look into it, as soon as possible. Thx for reporting this out, I thought we had an scenario of this on our testing suite.

from rematch.

semoal avatar semoal commented on September 28, 2024

Can't reproduce the issue with this test mate:

it('reducer without any argument', () => {
  const model = createModel<RootModel>()({
    state: 0,
    reducers: {
      inc(state) {
        return state
      },
    },
  })
  interface RootModel extends Models<RootModel> {
    myModel: typeof model
  }

  const store = init({ models: { myModel: model } })

  const { dispatch } = store
  dispatch.myModel.inc()
  // @ts-expect-error
  dispatch.myModel.inc(1)
})

Could you provide a sandbox?

from rematch.

semoal avatar semoal commented on September 28, 2024

1066936
Just pushed a commit to check against CI.

from rematch.

Javi avatar Javi commented on September 28, 2024

I'm finding the same trouble on 2.2.0 and not on 2.0.1 but not with a reducer but with a parameter-less effect.

from rematch.

semoal avatar semoal commented on September 28, 2024

I'm finding the same trouble on 2.2.0 and not on 2.0.1 but not with a reducer but with a parameter-less effect.

Hey Javi! Isn't this test

it('without any parameter', () => {
what you're doing/using?

I'm open to help if i can reproduce it somehow

from rematch.

hasan-aa avatar hasan-aa commented on September 28, 2024

I recently ported my project from next.js to create-react-app. Strangely this issue is happening only in create-react-app for me.
I had to downgrade to v2.0.1

from rematch.

semoal avatar semoal commented on September 28, 2024

Do you use any plugins? or something we can use to reproduce it?

from rematch.

alexkreidler avatar alexkreidler commented on September 28, 2024

I have the same issue, probably caused by a similar bug in the argument typing calculation:

(property) setMark: (payload: any, meta: any) => any
Expected 2 arguments, but got 1.

my code:

dispatch.chartEditor.setMark("point")

I believe the reason is because I didn't have an effects entry in that particular model. When I added one (effects: (dispatch) => ({}) or effects: {}), the error goes away.

from rematch.

semoal avatar semoal commented on September 28, 2024

I have the same issue, probably caused by a similar bug in the argument typing calculation:

(property) setMark: (payload: any, meta: any) => any
Expected 2 arguments, but got 1.

my code:

dispatch.chartEditor.setMark("point")

I believe the reason is because I didn't have an effects entry in that particular model. When I added one (effects: (dispatch) => ({}) or effects: {}), the error goes away.

Our testing suite of typings, tests that scenario, so I guess it should be something else.

from rematch.

darklight9811 avatar darklight9811 commented on September 28, 2024

This issue happens when I build my project on nextjs but not on my vscode. Something really weird is happening.

from rematch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.