rixo / svench

A lightweight workbench to develop your Svelte components in isolation
svench-docs.vercel.app
207 stars 6 forks source link

Error when running yarn svench for demo #6

Closed babycourageous closed 4 years ago

babycourageous commented 4 years ago

Hi there

I'm having some difficulty getting the Demo installation instructions to work.

After running into permissions issue using git to clone I cloned down the repo using degit. I then cd into examples.

I ran yarn and then yarn svench in the examples folder.

The following is the log:

$ SVENCH=1 rollup -cw
[routix] Watching Code/svench/example/src/**/*.(svench|svench.svelte|svench.svx)
[Svelte HMR] Setting css option to false (set hot.noDisableCss to true to bypass)
rollup v2.7.2
bundles src/main.js → public/build/bundle.js...
[HMR] Listening on port 38670
[HMR] Serving from RAM at http://127.0.0.1:38670
[routix] Written: routes.js, extras.js (250ms)
[!] (plugin svelte (hot)) ParseError: </p> attempted to close an element that was not open
src/999-examples.svench/CustomizeMenu.svench.svx
3: </script>
4: <s
5: <p>Pages can customize their title with <code>svench:title</code>:</p>
                                                                     ^
6: <pre class="language-svelte">
7: <code class="language-svelte">&lt;svench:options name=&quot;custom page title&quot; /&gt;</code>
ParseError: </p> attempted to close an element that was not open
    at error (Code/svench/example/node_modules/svelte/src/compiler/utils/error.ts:25:16)
    at Parser$1.error (Code/svench/example/node_modules/svelte/src/compiler/parse/index.ts:96:3)
    at tag (Code/stretchui.com/svench/example/node_modules/svelte/src/compiler/parse/state/tag.ts:137:12)
    at new Parser$1 (Code/svench/example/node_modules/svelte/src/compiler/parse/index.ts:48:12)
    at parse (Code/svench/example/node_modules/svelte/src/compiler/parse/index.ts:256:17)
    at compile (Code/svench/example/node_modules/svelte/src/compiler/compile/index.ts:79:14)
    at Code/svench/example/node_modules/rollup-plugin-svelte-hot/index.js:312:22
    at Code/svench/example/node_modules/rollup/dist/shared/rollup.js:17256:44
    at async Promise.all (index 32)
    at async Promise.all (index 1)

I've made no adjustments to the starter files. Thanks!

happybeing commented 4 years ago

I think this is the issue I had and if so the solution is to use node v12 (check node --version to see what you are using). I recommend using nvm to select node versions.

rixo commented 4 years ago

@babycourageous Hey! Sorry, I had failed to keep dependencies in the example up to date (working all npm linked locally...). The example in this repo should now be fixed.

You might want to check svench-component-template that is probably a little cleaner for now.

In the example from the main repo (here), you'll find more information about the current features but, unfortunately, the content organization is non-existent... I'm working on stabilizing the features before documenting too much.

Given the current stade of development, the component template is probably a better approach if you want to start using Svench right now... I am actively refactoring the "integration with an existing project" part that is illustrated in the example folder.

rixo commented 4 years ago

Closing the issue, since I managed to reproduce the same error, I'm confident the fix should work for you. Feel free to reopen or create another issue if you still have problems with Svench.

babycourageous commented 4 years ago

Thanks @rixo !