svelteit icon indicating copy to clipboard operation
svelteit copied to clipboard

Not able to use components after adding svelteit to my project

Open bhanuone opened this issue 5 years ago • 1 comments

I followed the docs to add svelteit to my project. After installing required packages and configuring the project. it is throwing the following error.

(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
@colorfuldots/svelteit/dist/css/svelteit.min.css (imported by src/App.svelte)
[!] (plugin svelte) ParseError: Identifier is expected
node_modules/@colorfuldots/svelteit/src/ButtonGroup.svelte
27:     vertical-align: middle;
28:
29:     > {
        ^
30:       :global(button:not(:first-child)),
31:       .svelteit-button-group:not(:first-child) > :global(button) {
ParseError: Identifier is expected
    at error (/home/bhanu/app/node_modules/svelte/src/compiler/utils/error.ts:25:16)
    at Parser$1.error (/home/bhanu/app/node_modules/svelte/src/compiler/parse/index.ts:93:3)
    at Object.read_style [as read] (/home/bhanu/app/node_modules/svelte/src/compiler/parse/read/style.ts:21:11)
    at tag (/home/bhanu/app/node_modules/svelte/src/compiler/parse/state/tag.ts:190:27)
    at new Parser$1 (/home/bhanu/app/node_modules/svelte/src/compiler/parse/index.ts:45:12)
    at parse (/home/bhanu/app/node_modules/svelte/src/compiler/parse/index.ts:208:17)
    at compile (/home/bhanu/app/node_modules/svelte/src/compiler/compile/index.ts:79:14)
    at preprocessPromise.then.code (/home/bhanu/app/node_modules/rollup-plugin-svelte/index.js:252:22)

Expected Behavior

It should work with a svelte project.

Actual Behavior

Throwing error during build.

Steps to Reproduce the Problem

Added the following code in root component App.svelte

<script>
  import "@colorfuldots/svelteit/dist/css/svelteit.min.css";
  import { Button } from "@colorfuldots/svelteit";
</script>

<div>
  <Button title="Test button" rounded primary />
</div>

Specifications

  • Version: ^1.0.0-alpha.7
  • Platform: Ubuntu 20.04
  • Subsystem:

bhanuone avatar Jul 12 '20 05:07 bhanuone

Hi @bhanuone I've faced the same issue and it disappeared after I added the preprocess to the config You can check 1 ~ 3 from the one for sapper https://docs.svelteit.dev/sapper

hyojin avatar Oct 22 '20 02:10 hyojin