just214 / svelte-custom-element

A project template to build custom elements (web components) with Svelte.
30 stars 3 forks source link

Cannot import Textfield from '@svelte-material-ui/textfield'; #1

Open st-clair-clarke opened 4 years ago

st-clair-clarke commented 4 years ago

Hi, I am wondering if I am doing something incorrect. In your App.svelte example, if I put

<script>
import Textfield from '@svelte-material-ui/textfield';
</script> 

and try to save the bundle, I get the following error

rollup v1.20.2
bundles src/main.js → public\bundle.js...
[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)
node_modules\@svelte-material-ui\textfield\_index.scss (1:0)
1: @import "smui-theme";
   ^
2: @import "./_style.scss";
Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)
    at error (J:\workspace\web-components\svelte\scc-address\node_modules\rollup\dist\rollup.js:9429:30)
    at Module.error (J:\workspace\web-components\svelte\scc-address\node_modules\rollup\dist\rollup.js:13412:9)
    at tryParse (J:\workspace\web-components\svelte\scc-address\node_modules\rollup\dist\rollup.js:13325:16)
    at Module.setSource (J:\workspace\web-components\svelte\scc-address\node_modules\rollup\dist\rollup.js:13639:33)
    at J:\workspace\web-components\svelte\scc-address\node_modules\rollup\dist\rollup.js:16425:20
    at async Promise.all (index 1)
    at async Promise.all (index 1)
    at async Promise.all (index 0)
    at async Promise.all (index 0)
    at async Promise.all (index 0)

1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "autobuild" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
just214 commented 4 years ago

Hi, I have not used this material library so it's hard to say what is causing the issue. From what I can see, it looks like the problem might be with rollup. Wish I could offer more insight, but I just really don't know.