beynar / svelte-dropzone

A simple & ssr ready wrapper around dropzone.JS for svelte/sapper.
35 stars 10 forks source link

Unexpected token < #1

Closed pkpowell closed 4 years ago

pkpowell commented 5 years ago

I'm getting this error in a svelte/sapper app. Any ideas?

/Users/phil/websites/image-library/node_modules/svelte-dropzone/index.svelte:1
<script>
^

SyntaxError: Unexpected token <
    at Module._compile (internal/modules/cjs/loader.js:720:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/phil/websites/image-library/__sapper__/dev/server/server.js:10:32)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)

There's a typo (unrelated) in the readme example

<script>
  import Dropzone from "sv-dropzone"

should be

<script>
  import Dropzone from "svelte-dropzone"
ghost commented 5 years ago

I got the same error, reinstall svelte-dropzone as a dev dependency

pkpowell commented 5 years ago

Brilliant, thanks!