-
Notifications
You must be signed in to change notification settings - Fork 33
Import error "cannot find module" #480
Comments
Thanks for filing issue! I'll need a little more information if that's okay: what's your Node version? Is your project a CommonJS module or ES module? |
Hey, thank you for taking the time and looking into it! The full error report looks like:
I am absolutely not sure, it can totally be a problem on my side, but yet again I did nothing more than importing the module... Are there any requirements? |
Hmm I'm not too familiar with how Vite resolves modules. But it looks like Vite is attempting to build scroll-js as a CommonJS module instead of ES module. scroll-js exposes multiple dist files that can be used, depending on how your project is set up. See Does that help at all? If not, I can try to pull Vite down and import it to see if I can reproduce. |
Hey @moritzebeling just checking in. Hopefully you found a resolution for your issue. I'll leave this open for a few more days. If I don't hear back from you, I'll assume all is well and close issue. Thanks again for your contributions! |
Hey Mark, thank you very much for checking back in. I was trying out several other plugins and now wanted to try yours once again because it seems to be one of the very few that support SSR and duration control :) I tried with the When trying to import directly from the source file I then copied the file import { scrollTo } from './scroll.js'; Unfortunately I don’t know enough about Vite, Rollup or CommonJS to really pinpoint how this could be resolved. It really only seems to be a configuration issue. And I also know that this is not the idea of open source modules, but I will now use is as a temporary workaround. Thank you! |
Hi, when I try to import your module
I get the following error:
I have no idea what this could mean... Any idea how I could get this to work?
Thank you in advance.
PS: I am using Vite with SvelteKit if that‘s of any help
The text was updated successfully, but these errors were encountered: