datatables icon indicating copy to clipboard operation
datatables copied to clipboard

Unable to find `src/shared/style.css`

Open icheered opened this issue 1 year ago • 1 comments

Starting a fresh svelte project and importing the latest version of the datatables library I get the following error:

Unable to resolve `@import "src/shared/style.css"` from /home/tjbakker/dev/lentedigital/datatableTesting/node_modules/@vincjo/datatables/dist/src/shared
✘ [ERROR] Error while preprocessing /home/tjbakker/dev/lentedigital/datatableTesting/node_modules/@vincjo/datatables/dist/src/shared/Datatable.svelte - [postcss] ENOENT: no such file or directory, open 'src/shared/style.css'

My guess this is caused by the following line in src/shared/Datatable.svelte:

    @import '$lib/src/shared/style.css';

Edit: Further investigation shows that it is working on version 34 but it breaks from version 35 onwards. I tried changing $lib/src/shared/style.css into simply ./style.css and the error disappears, but the custom styles in my own application that is using datatables is then completely messed up.

icheered avatar Oct 01 '24 14:10 icheered

Thank you very much for warning. I still need to work on handling CSS. The goal is to keep the current behavior but make CSS overwriting easier.

2.0.0-runes.32 is more stable in the meantime.

vincjo avatar Oct 01 '24 17:10 vincjo

Using import ./style.css in script tag instead of @import in style tag seems to fix the issue.

Fix: 2.0.0-runes.38

vincjo avatar Oct 04 '24 17:10 vincjo