-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
overlayscrollbars svelte webpack: Cannot read properties of undefined (reading '$$') #610
Comments
Good day @Wiblz :) I'm not too familiar of how webpack handles svelte bundles... I'll check it out as soon as I have time :) |
@Wiblz Please try to specify resolve: {
alias: {
svelte: path.resolve('node_modules', 'svelte/src/runtime'),
},
extensions: ['.mjs', '.js', '.svelte'],
mainFields: ['svelte', 'browser', 'module', 'main'],
conditionNames: ['svelte', 'browser', 'import', 'require', 'node'],
}, |
Short explanation why it wasn't working: Svelte has its own build logic and tries whenever to load the original Then there is also a second possibility for library authors to also provide a pre-compiled version of the component as a plain The problem here was that webpack resolved the With adding the Also Related: sveltejs/svelte#8295, https://github.com/sveltejs/svelte-loader |
@KingSora Thank you for a prompt response. I think I understand your explanation of why it wasn't working at least on a conceptual level. Unfortunately because my lack of knowledge of front end build tools and webpack specifically I can't fully understand how adding I attempted the proposed solution but it broke my build with 40+ errors coming from other dependencies. I then tried setting conditionNames to different subsets of given values (again, completely oblivious of what I was actually changing) and found that some of them resulted in a successful build. In the end, I settled with |
@Wiblz I'm glad you found a solution! :) Can I consider the issue as fixed? |
@KingSora Yeah, sure. |
Describe the bug
Getting "Cannot read properties of undefined (reading '$$')" in overlayscrollbars-svelte.mjs:281 when trying to use the most basic example of overlayscrollbars-svelte in a webpack setup.
To Reproduce
Here's a minimized setup of my project: stackblitz
I can feel that my webpack setup is a bit scuffed, so it could be that.
The text was updated successfully, but these errors were encountered: