Changing my nuxt project's localhost to be my local ip makes the site works only at the first load, then "Unable to fetch collections" happens

Viewed 315

I want to run Nuxt at my local IP so that I can access the website from any device in my Network, So I run the following command:

'HOST=0 PORT=8000 npm run dev'

The Result: The website is accessible from any device in my network, But it's working with many data missed. It's loaded the first time, but after executing some action, a message appears that says "unable to fetch collections".

I can use Ngrok, but I think it's an unsafe option that may be used in certain cases.

I'll appreciate your help all of you. Thanks in advance!

1 Answers

Did you configure the server in nuxt.config file ?

Like this:

...
server: {
  host: '0' // default: localhost
}
...
Related