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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

croact-moveable requires croact but does not specify in package.json #937

Open
gabor opened this issue Jun 1, 2023 · 3 comments
Open

croact-moveable requires croact but does not specify in package.json #937

gabor opened this issue Jun 1, 2023 · 3 comments
Labels
question Further information is requested

Comments

@gabor
Copy link

gabor commented Jun 1, 2023

running the croact-moveable package complains that there is a missing dependency.

how to reproduce the problem:

  1. npm init
  2. npm add croact-moveable
  3. run node, and inside run require('croact-moveable')
    you get this error-message:
Uncaught Error: Cannot find module 'croact'
Require stack:
- .../node_modules/croact-moveable/dist/moveable.cjs.js

(in this case you can workaround it by just installing croact, but if you use yarn for example, which only allows loading code from packages that your package depends on, it becomes a harder problem)

@daybrush daybrush added the question Further information is requested label Jun 1, 2023
@daybrush
Copy link
Owner

daybrush commented Jun 1, 2023

@gabor

Can you tell me why you are installing croact-moveable yourself?

Although not recommended, if you want to use croact-moveable directly, install croact.

If not, use the following moveable depending on the framework or environment you are using.

  • movable
  • vue-movable (vue2)
  • vue3-movable (vue3)
  • ngx-movable
  • svelte-movable
  • lit-movable
  • react-movable

@gabor
Copy link
Author

gabor commented Jun 2, 2023

@daybrush hi, thanks for the recommendations!

technically speaking i am not installing it alone. i am installing the other parts too, but this is all installed using yarn, and yarn makes sure that a package can only see things that it is supposed to see.

and i think, if the package croact-moveable imports croact, then it should have croact in the list of dependencies, shouldn't it?

@daybrush
Copy link
Owner

daybrush commented Jun 2, 2023

@gabor

Taking react as an example, the react-moveable component uses react as its devDependency.

So I'm using croact as the devDependency for croact-moveable as well.

Also, since croact-moveable is a compatible step component,
I didn't set any dependencies.

Instead I'm using croact, croact-moveable from the moveable package.

Instead I would add peerDependencies.

daybrush added a commit that referenced this issue Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants