svelte-filepond icon indicating copy to clipboard operation
svelte-filepond copied to clipboard

404's on CSS files in sapper

Open MTyson opened this issue 3 years ago • 7 comments

Describe the bug

Following the example in this repo, I get 404s when importing the CSS files:

Logs

GET http://localhost:3000/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css net::ERR_ABORTED 404 (Not Found)
create:1 GET http://localhost:3000/filepond/dist/filepond.min.css net::ERR_ABORTED 404 (Not Found)

This may be something I'm doing dumb rather than a bug.

MTyson avatar Apr 22 '21 22:04 MTyson

I worked around this by changing the import in Component.svelte to:

import '../../filepond/dist/filepond.min.css';

In the script tag.

MTyson avatar Apr 23 '21 22:04 MTyson

@MTyson thanks, will look into this when I have some time.

rikschennink avatar Apr 26 '21 08:04 rikschennink

Thanks for the component, it is working great now @rikschennink

MTyson avatar Apr 29 '21 21:04 MTyson

I am having the same issue getting the css to work as shown in the docs. Tanks for the workaround MTyson.

hobbitronics avatar May 06 '21 18:05 hobbitronics

I had to pull the code into my project because when building to production, the workaround is lost.

MTyson avatar May 06 '21 21:05 MTyson

I've restructured the component, hope that helps. The css import is now separate from the Svelte component and no longer in the <style> tag, this seems to work in my test. Published as 0.2.0

import 'filepond/dist/filepond.min.css';

rikschennink avatar May 10 '21 07:05 rikschennink

Awesome, thanks again.

MTyson avatar May 11 '21 20:05 MTyson