Giter VIP home page Giter VIP logo

Comments (3)

michael-spengler avatar michael-spengler commented on May 28, 2024

@felixsanz: I'm relatively new as a snel contributor. It seems you explored the details on that pretty thoroughly already. Would it be possible for you to raise a pull request suggesting a solution?

one spontaneous thought from my side was that it might be interesting how what you describe fits together with: https://github.com/crewdevio/Snel/blob/main/install.ts#L15

from snel.

felixsanz avatar felixsanz commented on May 28, 2024

sorry i don't know how to fix it

from snel.

omar-azmi avatar omar-azmi commented on May 28, 2024

I was having issues with svelte/store in addition to typescript transpilation. After migrating to node based svelte, the problem persisted and I discovered that the issue lied in my windows project directory path containing a single apostrophe/quote (ie: C:/some-dir/client's website/proj/). Changing the directory to a apostrophe/quotation-free path fixed the issue with both snel and regular node svelte. So I guess the problem lies more or less with sveltejs or the preprocessors, not snel.
Give it a shot with the test project below:
If the output site functions correctly, you should see a random 9-digit id that turns into **A SECRET** after 3 seconds

C:/temp> snel create proj
C:/temp> cd proj
// <!-- "C:/temp/proj/src/sitestore.ts" -->
import { writable } from "svelte/store"
export const uuid: string = writable(Math.random().toString().replace("0.", "").slice(0, 9))
<!-- "C:/temp/proj/src/components/Home.svelte" -->
<script lang="ts">
import { uuid } from "~/sitestore.ts"
export let name: string;
// keep in mind that whenever reading a store value, you must prefix the variable name with a $ dollar symbol
// in the console log below, it would be incorrect to use "uuid" to acquire the value. you must use "$uuid" instead
console.log(`this session\'s id is ${$uuid}`)
</script>

<h1>Hello {name}!</h1>
<h1>Your unique id is: {$uuid}</h1>

<style>
h1 {
	color: #ff3e00;
	text-transform: uppercase;
	font-size: 4em;
	font-weight: 100;
}
</style>
<!-- ""C:/temp/proj/src/App.svelte"" -->
<script>
import Home from "~/components/Home.svelte";
import { fade } from "svelte/transition";
import { uuid } from "~/sitestore.ts"

let name = "World";
setTimeout(() => {uuid.set("**A SECRET**")}, 3000)
</script>

<main transition:fade>
	<Home {name} />
</main>

<style>
main {
	text-align: center;
}
</style>
C:/temp/proj> snel serve

from snel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.