Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: guard: expect clock to be a unit (store, event or effect) or array of units #75

Closed
kozlovzxc opened this issue Jan 22, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@kozlovzxc
Copy link

kozlovzxc commented Jan 22, 2022

Hey 馃憢 Not sure if I'm doing something wrong or there is actually a bug.

So I have this packages installed:

        "effector": "^21.8.11",
        "effector-react": "^21.3.2",
        "effector-logger": "^0.13.3",

And I'm using parcel v2 as a builder.

Every time I try to use anything related to effector-logger I get this error

image

I get this error either if I import bablel config or either just directly import something from 'effector-logger'.

Which other details can be useful?

@kozlovzxc
Copy link
Author

Maybe it's related to #65

@AlexandrHoroshih
Copy link
Member

Looks like a effector/effector#601 馃

@kozlovzxc
Copy link
Author

Just noticed, that I have outdated effector version (v21 compared to latest v22), going to update and check if it still persists

@kozlovzxc
Copy link
Author

kozlovzxc commented Jan 22, 2022

Updated all packages to the latest versions, now there is this error 馃

image

        "effector": "^22.1.2",
        "effector-react": "^22.0.6",
        "effector-logger": "^0.13.3",

@AlexandrHoroshih
Copy link
Member

馃 Could you try to clear cache of the bundler? Just in case

@kozlovzxc
Copy link
Author

kozlovzxc commented Jan 22, 2022

Looks like effector doesn't work with parcel itself 馃

Here is repo with just 2 packages - effector & parcel - https://github.com/kozlovzxc/parcel-effector-example/

image

And if I use stackblitz to reproduce it, it works
image

As for code, I'm using example from docs themselves

import {createEvent, createStore} from 'effector'

const addTodo = createEvent()
const clearTodoList = createEvent()

const $todos = createStore([])
  // Will update store when addTodo is fired
  .on(addTodo, (list, todo) => [...list, todo])
  // Will reset store to default state when clearTodos is fired
  .reset(clearTodoList)

// Log initial store value and each change
$todos.watch(todos => {
  console.log('todos', todos)
})
// => todos []

addTodo('go shopping')
// => todos ['go shopping']

addTodo('go to the gym')
// => todos ['go shopping', 'go to the gym']

clearTodoList()
// => todos []

@AlexandrHoroshih Should I open issue in effector main repo?

@kozlovzxc
Copy link
Author

kozlovzxc commented Jan 22, 2022

Just by downgrading version in this example, figure out that effector@21.8.12 works and effector@22.0.0 doesn't, also looks like effector-logger@0.11.0 is the latest version of logger, which works with effector@21.8.12.

Maybe this will help someone.

@kozlovzxc
Copy link
Author

Btw, maybe this is resolved issue, but maybe it relates to parcel somehow again. Looks like names are minified for effector@21.8.12 & effector-logger@0.11.0

image

@kozlovzxc
Copy link
Author

Please let me know if I can help somehow or if you need any other details 馃檹

@sergeysova sergeysova added seems outdated bug Something isn't working and removed seems outdated labels Aug 3, 2022
@AlexandrHoroshih
Copy link
Member

Hello!

As of the recent '0.14.0' release, 'effector-logger' no longer includes 'effector-inspector' and integration with redux-devtools, so all related issues are gone.

Also, logger does not require any plugins to work anymore, so all related issues are gone too.
Usage of "effector/babel-plugin" is still desirable though, as it provides useful metadata for the logs.

See the release notes for details
https://github.com/effector/logger/releases/tag/v0.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants