6eDesign / svelte-calendar

A lightweight datepicker with neat animations and a unique UX.
https://6edesign.github.io/svelte-calendar/
MIT License
543 stars 90 forks source link

Can't find a module with sapper 0.28 default app #91

Closed Bighamster closed 4 years ago

Bighamster commented 4 years ago

npx degit "sveltejs/sapper-template#rollup" my-app

index.svelte:

<script>
    import Datepicker from 'svelte-calendar'
</script>

<Datepicker />

output:

internal/modules/cjs/loader.js:968
  throw err;
  ^
Error: Cannot find module 'svelte-calendar
antony commented 4 years ago

Did you install the node module?

Bighamster commented 4 years ago

Did you install the node module?

No. Everything was working fine before installing 0.28

I even tried the default app (npx degit "sveltejs/sapper-template#rollup" my-app) ... without success.

Temporaraly I use the component this way:

import Datepicker from 'svelte-calendar/src/Components/Datepicker.svelte'
antony commented 4 years ago

I've just tried exactly what you suggested:

npx degit "sveltejs/sapper-template#rollup" my-app

then installed the node module and added it to the page. it works fine.

Screenshot from 2020-08-14 16-38-53

It sounds like whatever project you're trying to use it on isn't looking at the svelte field in package.json which is the misconfiguration mentioned here - https://github.com/6eDesign/svelte-calendar/issues/85

However, the base Sapper 0.28 template does have this configuration, and it works as expected.

Bighamster commented 4 years ago

Oh! I found out what the problem was ... I've installed into dependencies instead of devDependencies ... Shame on me!

Thanks a lot!

blackavec commented 4 years ago

https://github.com/6eDesign/svelte-calendar/pull/95

i have created a small PR to fix the missing part in document. i know it might be very simple and not that important but i think it's missing in documentation. i personally spend few hours on it until i found the solution here.