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

Using @nuxtjs/router breaks nuxi generate #415

Open
MartinX3 opened this issue Jul 13, 2022 · 0 comments
Open

Using @nuxtjs/router breaks nuxi generate #415

MartinX3 opened this issue Jul 13, 2022 · 0 comments

Comments

@MartinX3
Copy link

Environment

Nuxt CLI v3.0.0-rc.5 00:24:09
RootDir: /home/developer/verein/rtc-koeln/Rad-Touristik-Club-Koln-e-V-1972.github.io 00:24:09
Nuxt project info: 00:24:09



Reproduction

['@nuxtjs/router', { fileName: 'router.ts' }],

import Vue from 'vue'
import Router from 'vue-router'
import VIndex from '~/pages/VIndex.vue'
import VCalendar from '~/pages/VCalendar.vue'
import VContact from '~/pages/VContact.vue'
import VGallery from '~/pages/VGallery.vue'
import VGuestbook from '~/pages/VGuestbook.vue'

Vue.use(Router)

export function createRouter() {
    return new Router({
        mode: 'history',
        routes: [
            {
                component: VIndex,
                name: 'index',
                path: '',
            },
            {
                component: VCalendar,
                name: 'calendar',
                path: '/calendar',
            },
            {
                component: VContact,
                name: 'contact',
                path: '/contact',
            },
            {
                component: VGallery,
                name: 'gallery',
                path: '/gallery',
            },
            {
                component: VGuestbook,
                name: 'guestbook',
                path: '/guestbook',
            },
        ],
    })
}

Describe the bug

Using a router.ts works fine with nuxi dev, but with nuxi generate the index.html and the folders with the components are missing.
It works with node .output/server/index.mjs, but not uploaded to a static site.

Additional context

No response

Logs

Nuxt CLI v3.0.0-rc.5                                                                                                                                                        00:21:32
ℹ Production build                                                                                                                                                          00:21:35
ℹ Bundling only for client side                                                                                                                                             00:21:35
ℹ Target: static                                                                                                                                                            00:21:35
ℹ Using components loader to optimize imports                                                                                                                               00:21:35
ℹ Discovered Components: .nuxt/components/readme.md                                                                                                                         00:21:35
✔ Builder initialized                                                                                                                                                       00:21:35
✔ Nuxt files generated                                                                                                                                                      00:21:35

✔ Client
  Compiled successfully in 59.04s


Hash: c9d5f2283fd5389c2fbc
Version: webpack 4.46.0
Time: 59042ms
Built at: 14.07.2022 00:22:35
                           Asset      Size  Chunks                                Chunk Names
  ../server/client.manifest.json  41.6 KiB          [emitted]                     
                      06dfcef.js   246 KiB       1  [emitted] [immutable]  [big]  commons/app
                      56ee819.js  1.49 KiB       2  [emitted] [immutable]         runtime
                        LICENSES  3.95 KiB          [emitted]                     
                      e96d531.js   173 KiB       0  [emitted] [immutable]         app
                      f40f709.js  1.92 MiB       3  [emitted] [immutable]  [big]  vendors/app
fonts/TacticSans-Bld.d0dcd35.otf  66.3 KiB          [emitted] [immutable]         
fonts/TacticSans-Reg.745135e.otf  64.5 KiB          [emitted] [immutable]         
 img/banner_vertikal.cc7568d.svg  3.99 KiB          [emitted] [immutable]         
 + 1 hidden asset
Entrypoint app [big] = 56ee819.js 06dfcef.js f40f709.js e96d531.js

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  06dfcef.js (246 KiB)
  f40f709.js (1.92 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (1000 KiB). This can impact web performance.
Entrypoints:
  app (2.33 MiB)
      56ee819.js
      06dfcef.js
      f40f709.js
      e96d531.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
✔ Generated public .output/public                                                                                                                                     nitro 00:22:35
ℹ Generating output directory: public/                                                                                                                                      00:22:35
ℹ Generating pages                                                                                                                                                          00:22:37
✔ Client-side fallback created: 200.html                                                                                                                                    00:22:37
start Building server...                                                                                                                                              nitro 00:22:37
start Writing server bundle...                                                                                                                                        nitro 00:22:38
✔ Server built                                                                                                                                                        nitro 00:22:38
  ├─ .output/server/package.json (307 B) (183 B gzip)
  ├─ .output/server/index.mjs (458 B) (257 B gzip)
  ├─ .output/server/chunks/nitro/node-server.mjs.map (57.6 kB) (4.44 kB gzip)
  ├─ .output/server/chunks/nitro/node-server.mjs (17.1 kB) (5.5 kB gzip)
  ├─ .output/server/chunks/handlers/renderer.mjs.map (16.7 kB) (2.93 kB gzip)
  ├─ .output/server/chunks/handlers/renderer.mjs (12.6 kB) (4.09 kB gzip)
  ├─ .output/server/chunks/app/client.manifest.mjs.map (60.6 kB) (639 B gzip)
  └─ .output/server/chunks/app/client.manifest.mjs (42.7 kB) (7.52 kB gzip)
Σ Total size: 740 kB (155 kB gzip)
✔ You can preview this build using node .output/server/index.mjs                                                                                                      nitro 00:22:38
✔ You can now deploy .output/public to any static hosting!                                                                                                                  00:22:38

Process finished with exit code 0
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

1 participant