-
Notifications
You must be signed in to change notification settings - Fork 36
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
Uncaught TypeError: useDragDropContext is not a function or its return value is not iterable #63
Comments
Hmm. That's definitely unexpected. I'll try and take a look at the weekend. |
Oh wait, what does your vite config look like? |
Hello! Is this issue resolved? If yes, would like to know what happened? If no, I also need some help regarding the same issue. |
I'll need an example repo of this happening in order to help more. Can you share a link to where this is occurring for you? |
Hi! The same problem.
|
Check your optimizeDeps: {
extensions: ["jsx"],
}, For example: import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
export default defineConfig({
plugins: [solidPlugin()],
server: {
port: 3000,
},
build: {
target: 'esnext',
},
optimizeDeps: {
extensions: ["jsx"],
},
}); |
My config:
It's doesn't help. The issue still not resolved. ( |
For reference, I tested by creating a new repo from the solid ts template, updated all dependencies to latest and installed solid-dnd. This worked for me 🤷♂️ I'll need more info to help further:
|
Perhaps, I found what’s wrong. If I import createDraggable and define Draggable component directly in App.jsx everything works. But if make component in separate file I see the error on step const draggable = createDraggable() Maybe I don't understand something fundamental in Solid |
Are you using the needed |
After a few hours of dancing it finally works ))) I made the new project and move all my components there step by step. So, I don't know what exactly was wrong but I'm sure optimizeDeps make sense, because without that option the error appears every time. |
Good to hear! Curious: do you still have that alias entry in your vite config? If not, perhaps that was causing an issue. |
My vite config looks exactly like I posted before. |
@martinpengellyphillips sorry for being out of touch. You r right: optimizeDeps: {
extensions: ["jsx"],
}, fixes this issue for me. Thank you 🙏 |
what this code does?
|
we need to delete |
I'm not able to use it too and no solution worked for me, except for this: I basically switch the exports map putting "solid" as last entry 😄. That's not a good solution since there are no reason of why it's working in this way. There is also reproducible example in a PR for my project where I'm trying to update all dependencies (both solid and solid-dnd) EDIT: I noticed that the 0.7.2 pkg has "0.7.1" version at package.json. Could this be a bad module resolution with pnpm and vite 3? 🤔 |
@martinpengellyphillips , I ran into this issue an was able to drill down to see that useDragDropContext from dev.jsx was returning
I suspect the trouble in my actual codebase is due to putting the provider inside a conditional render or something. Going to try to start small and add to a working example until I break it, but hopefully this insight helps show what might be happening. Definitely a failure of the context not being available during the |
In newly created Solid.js application from template, installing the
solid-dnd
dependencies and copy-paste an example I have the next error within the white page:App.tsx
package.json
Thank you in advance for any thought on this point.
Might be i'm doing something wrong, cause I just started to dig into solid ^^
The text was updated successfully, but these errors were encountered: