svelte@next with postcss and tailwind
UPDATE :
5.update to SvelteKit Vite, all work. This post outdate and will not maintain anymore, c...
For further actions, you may consider blocking this person and/or reporting abuse
I think this its only working with the initial kit version, with the latest version its not working :(
I try different things and always is the same error;
Error: NOT_FOUND
at Object.loadUrl (....../svelte-next/node_modules/.pnpm/snowpack@3.0.0-rc.2/node_modules/snowpack/src/commands/dev.ts:607:13)
at ....../svelte-next/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.14/node_modules/@sveltejs/kit/src/api/dev/index.js:165:14
it was not working for my at first also, but i manage to get it working on my way, here are my config.
first create a project like you normal do pnpm init svelte@next project-name
then edit your files as the one that im using, after that run pnpm i, and wait for the install to finish after that, pnpm run dev and done.
URL: codeshare.io/5XbRjj
with this change the preload function hook its not working
well that did work! buuut, know the i18n is broken :*(
Error: [svelte-i18n] Cannot format a message without first setting the initial locale.
:(
that's some error regarding svelte-i18n follow this instructions to make it work github.com/kaisermann/svelte-i18n/...
thanks, i already update the post for this error,,
Hi, Dan. This is very helpful.
Have you experienced an issued with the "hover:underline" in the index.svelte file?. I'm getting an error
Build Error: @snowpack/plugin-svelte
Semicolon or block is expected (31:32)
29: }
30: a {
31: @apply text-indigo-600 hover:underline;
^
32: }
It seems it's not able to process the CSS correctly. Once I remove that, it works.
hm,, it's hard because you don't use the code style,,
i think it would be the
I think I found the issue.
The file svelte.config does not have the ´postcss: true´ in the repo
github.com/dansvel/sveltekit-types...
However, it does instruct that property in this current page. Once I applied that config, it worked fine. Thanks.
You may want to apply that fix in the repo as well.
aw man,, thanks,, i already update the file,,
i still in experiment to make the repo as simple as possible,,
Thanks. I'm sorry about the format. I didn't make any change to your code, I simply clone the repo and it didn´t worked for me as is. The code doesn´t have any space.
I try Svelte Kit today and get this error:
currently you cannot use any postcss or typescript. But you could init a project with no typescript and and only css and you should also get the dev server running. This is the tracking issue as far as I know:
github.com/vitejs/vite/issues/2391
Thanks
tried to run dev
(node:92442) ExperimentalWarning: The ESM module loader is experimental.
I'll stop now)
for now, the latest version of svelte kit is using esm, and vite as builder and everything is broken,,
if you want to try sveltekit work,, you need specify the version,, maybe nex.29 or next.34 in your
package.json
file,,for more information, check sk-incognito.vercel.app/learn/what...
the maintaner of sveltekit said, better to work with sapper, coz migrating will easy,,
thx
oh,, sorry,,
i think i know why it doesn't export
index.html
is because insvelte.config.js
the adapter isnode
,try to install
@sveltejs/adapter-static
and change thesvelte.config.js
adapter tostatic
@avorona , I think I've found the problem, I think it's because svelte compiles all files into
.js
,, soglobal.pcss
becomesglobal.js
,, orindex.pcss
or other namewhat we can do to run the
run build
without problems,global.pcss
toGlobalStyle.svelte
GlobalStyle.svelte
to be something like this$layout.svelte
do the
run build
,, and,, BOOM!!! no errorplease CMIIW
Why not inside the $layout.svelte?
As far as I know from the Svelte Discord channel, running it is broken right now for Typescript, for JavaScript it should work.
For Typescript, a workaround is to add
to the
package.json
I still haven't found a way ,,
from npmjs.com/package/@sveltejs/kit
Hi dan, it may help to clarify that "$layout.svelte on root" means
src/routes/$layout.svelte
and to fix the typo in "Create src\routes.pcss" tosrc/routes/global.pcss
very thanks,
i write it in late night, like 2.30 am,,
I think now the preload funcition tis not working;
export async function preload({ host, path, params, query }, session) {
console.log('working')
}
i think it's sveltekit problem different from sapper,, need to wait for documentation for more
preload function has been renamed to load;
twitter.com/Rich_Harris/status/134...
i found the way to generate
build/
directory,,just run
npx svelte-kit adapt
after you run build commandThanks, dan!
adding a @snowpack/plugin-svelte at the initial kit version helped me run the project
the problem i face is, when i try to
run build
on fresh install project it's always give me error.have you tried too?
yeap :( got an error
dev-to-uploads.s3.amazonaws.com/i/...
thanks for mention it, i really forgot about
snowpack.config.js
i already update it,,same for me, was anyone able to get this to work?
check my reply above to Dan, i manage to get it working
i made more update to fix more things,, hope that will help,,
how can i run the build using Node?
i mean abuild cpntaining client and sever parts
thank you