Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any success with setup lando with vite, default frontend framework for laravel ? #24

Open
robert-abram opened this issue Sep 5, 2022 · 2 comments

Comments

@robert-abram
Copy link

robert-abram commented Sep 5, 2022

I'v tried everything, and any of this working my latest config

  node:
    type: node:16
    ssl: true
    scanner: false
    ports:
      - 3009:3009
    build:
      - npm install
    overrides:
      ports:
        - 3009 # Not sure if we need this

and vite.config.js

server: {
		host:true,
		hmr: {
			host: 'vite.lndo.site',
			clientPort: '80',
		},
		port: 3009
	},

Then i run lando npm run dev, to start vite server, but without success

@rtfm-47 rtfm-47 transferred this issue from lando/lando Sep 5, 2022
@sinnbeck
Copy link

sinnbeck commented Sep 5, 2022

I got it working, but only with http, not https. I added a seperate service for node

  node:
    type: node:16
    ssl: true
    scanner: false
    ports:
      - 3009:3009
    build:
      - npm install

and

tooling:
  dev:
    service: node
    cmd: npm run dev

and my server in vite.config.js

    server: {
        https: false,
        host: true,
        port: 3009,
        hmr: {host: '0.0.0.0'},
    },

If you have any luck getting it working with https, I would be interested in knowing this.

@sinnbeck
Copy link

sinnbeck commented Sep 5, 2022

Ok just tried to get https working.. And this time I did!

This is the server block.

    server: {
        https: false,
        host: true,
        port: 3009,
        hmr: {host: 'localhost', protocol: 'ws'},
    },

Even though it is running http/ws, it is using localhost which the browser will allow to work with https on the site itself :)

Wrote a small blog post: https://sinnbeck.dev/posts/getting-vite-and-laravel-to-work-with-lando

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants