mihatorikei / codeigniter-vitejs

ViteJS Integration For Codeigniter4 🔥⚡
MIT License
93 stars 11 forks source link

Accessing the website using localhost:3479 throws error #11

Closed seunex17 closed 2 years ago

seunex17 commented 2 years ago

After running npm run dev and create a server via htpp://localhost:3479 throws error 404 page

image

jaguarch commented 2 years ago

Hi Open codeigniter server instead, default: http://localhost:8080

BTW, did you install node dependencies?

seunex17 commented 2 years ago

After creating a new CI4 project I then install your package and use php spark vite:init --framework svelte this then install svelte and I run npm run dev and throw above error am I missing something?

jaguarch commented 2 years ago

Yup, you didn't run php spark serve then you should open http://localhost:8080 instead.

seunex17 commented 2 years ago

The doc set run npm run dev. Well will take a look again. Well I am not seeing App.svelte in my public folder.

Will appreciate an example project to fully take a look at this.

jaguarch commented 2 years ago

Let me make it clear

About the example project, is almost ready it's just a matter of day or two

mihatorikei commented 2 years ago

After following the installation instructions, run php spark serve and access your project through codeigniter development server wich is by default http://localhost:8080

php spark vite:init will generate a resources folder and you should find your App.svelete there

PwrSrg commented 2 years ago

I had the exact same issue, and finally just gave up.

You really need to update your documentation to make it clear that you actually need to be running TWO terminals - one running Vite, and second one running CodeIgniter at the same time.

That would have saved me a ton of time and frustration.

mihatorikei commented 2 years ago

Hi @PwrSrg You're right, i'm sorry about that i'm currently working on starter app for vue and svelte, but I would appreciate it if someone could help me with the documentation

mihatorikei commented 2 years ago

13

mihatorikei commented 2 years ago

@seunex17 check this out https://github.com/firtadokei/ci-svelte-appstarter

seunex17 commented 2 years ago

@firtadokei perfect a very big thank you

PwrSrg commented 2 years ago

NICE! 🤩

Gildedter commented 2 years ago

I run my project inside my laragon www path using nginx, then just open the v-host path on my browser (while vite is listening for changes on a separate terminal), is running spark required?

mihatorikei commented 2 years ago

@Gildedter nope, spark is not required