sveltejs / svelte-scroller

A <Scroller> component for Svelte apps
https://svelte.dev/repl/76846b7ae27b3a21becb64ffd6e9d4a6
Other
347 stars 25 forks source link

Does svelte-scroller has been tested with Sapper? #2

Open frenk196 opened 6 years ago

frenk196 commented 6 years ago

I'm trying to use svelte-scroller following the README instructions with Sapper 0.13.0 and the sapper-template. Unfortunately I got the following error: UnhandledPromiseRejectionWarning: TypeError: _sveltejs_svelte_scroller__WEBPACK_IMPORTED_MODULE_1___default.a._render is not a function

Please, can you help me to understand why this happens? I'm doing something wrong?

Thank you.

cssandstuff commented 6 years ago

@frenk196 this might help: https://stackoverflow.com/questions/50330825/sapper-and-svelte-scroller-example

or you can keep the configs as they are and see this line in server.config.js

externals: Object.keys(pkg.dependencies),

it excludes all your dependencies from the compiler

So if you remove "@sveltejs/svelte-scroller": "^1.0.4", from your package.json then it will be processed by the webpack compiler and should work.

I guess there should be a more clever way of doing this but I don't know what it is as yet.