madhusudanbabar / k-domains

A simple module to manage multiple subdomains with just one project
https://www.npmjs.com/package/k-domains
MIT License
52 stars 8 forks source link

Doesn't seem to work for me #5

Closed miketeix closed 3 years ago

miketeix commented 3 years ago

Hi there,

here's my nuxt.config buildModules section:

 buildModules: [
    [
      'k-domains',
      {
        subDomains: ['app'],
        rootDomain: 'root',
      },
    ],
    [
      '@nuxtjs/router',
      {
        keepDefaultRouter: true, // this line is mandatory...
      },
    ],
  ],

and so I expect app.myDomain/ to render the index.vue inside my pages/app directory

similarly, I expect myDomain/ to render the index.vue inside my pages/root directory

Instead I get a This page could not be found nuxt error: image

Am I missing something?

thanks!

madhusudanbabar commented 3 years ago

Can you share your pages tree? I guess you may have an index.vue page in your pages directory. Can you paste the error message? I'm unable to see the white-colored text.

miketeix commented 3 years ago

Hey thanks for the reply, here's my page tree:

pages
   /app
       index.vue
       /otherPage
       /otherPage
   /root
      index.vue
      /otherPage

Oh the white-colored text is actually the footer of the page, so the error is "Page is not found".

Should I not have an index.vue in my pages directory?

shoxadomokai commented 3 years ago

@miketeix did you ever get a solution to this? I'm having the same problem.

I also get the following warnings when building nuxt begins building. I don't know if related or not;

madhusudanbabar commented 3 years ago

@miketeix did you ever get a solution to this? I'm having the same problem.

I also get the following warnings when building nuxt begins building. I don't know if related or not;

  • No router.js found in [project_directory]
  • no proxy defined on top-level

you need to add the k-domains first in the nuxt.config.js or at least before the @nuxtjs/router module, the warning no router.js found is coming from the @nuxtjs/router.