nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

"export 'onBeforeUnmount' was not found in 'vue' and missing `.output` #393

Closed MartinX3 closed 2 years ago

MartinX3 commented 2 years ago

Environment

bridge: {
    nitro: false, # important flag to trigger this bug
},
ssr: true,
target: 'static',

and

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

------------------------------
- Operating System: `Linux`
- Node Version:     `v18.5.0`
- Nuxt Version:     `2.16.0-27616340.013f051b`
- Package Manager:  `npm@8.13.0`
- Builder:          `webpack`
- User Config:      `bridge`, `build`, `buildModules`, `components`, `css`, `head`, `modules`, `nitro`, `plugins`, `ssr`, `target`, `serverHandlers`, `devServerHandlers`
- Runtime Modules:  `-`
- Build Modules:    `@nuxtjs/stylelint-module@4.1.0`, `@nuxtjs/vuetify@1.12.3`, `@pinia/nuxt@0.1.9`, `@nuxt/bridge@3.0.0-27621385.6ebdec4`
------------------------------

Reproduction

nuxi generate

Describe the bug

missing .output folder and a warning in the logs.

Additional context

No response

Logs

> nuxi generate

Nuxt CLI v3.0.0-rc.4                                                                                                                                                        18:01:16
ℹ Production build                                                                                                                                                          18:01:19
ℹ Bundling for server and client side                                                                                                                                       18:01:19
ℹ Target: static                                                                                                                                                            18:01:19
ℹ Using components loader to optimize imports                                                                                                                               18:01:19
ℹ Discovered Components: .nuxt/components/readme.md                                                                                                                         18:01:19
✔ Builder initialized                                                                                                                                                       18:01:19
✔ Nuxt files generated                                                                                                                                                      18:01:19

✔ Client
  Compiled successfully in 1.07m

✔ Server
  Compiled successfully in 37.60s

Hash: c34a5778aefc571b9b82
Version: webpack 4.46.0
Time: 64313ms
Built at: 08.07.2022 18:02:24
                           Asset       Size             Chunks                                Chunk Names
  ../server/client.manifest.json   40.7 KiB                     [emitted]                     
                      0ef0dd2.js   55.6 KiB                  2  [emitted] [immutable]         vendors/components/page-calendar-c-list/components/page-calendar-list-filter-c-date-range/pages/calendar
                      120b60a.js   5.95 KiB                  8  [emitted] [immutable]         components/page-c-guestbook
                      1c5ef29.js   7.89 KiB              16, 7  [emitted] [immutable]         pages/contact
                      36c556c.js   10.6 KiB                 14  [emitted] [immutable]         components/page-gallery-d-view
                      60a1692.js    2.5 KiB                 20  [emitted] [immutable]         runtime
                      610c2db.js   1.65 MiB                 21  [emitted] [immutable]  [big]  vendors/app
                      6904171.js   2.34 KiB                  9  [emitted] [immutable]         components/page-calendar-c-control
                      8b28130.js   78.7 KiB                  5  [emitted] [immutable]         app
                      8d3ad2a.js   68.8 KiB  15, 9, 10, 12, 13  [emitted] [immutable]         pages/calendar
                      8d62698.js  679 bytes                 11  [emitted] [immutable]         components/page-calendar-list-c-search
                      8e79ed2.js   6.16 KiB         10, 12, 13  [emitted] [immutable]         components/page-calendar-c-list
                      9803733.js    244 KiB                  6  [emitted] [immutable]  [big]  commons/app
                        LICENSES   3.95 KiB                     [emitted]                     
                      a408cc3.js   48.9 KiB                  0  [emitted] [immutable]         vendors/components/page-calendar-c-list/components/page-calendar-list-c-search/components/page-calen/268ca519
                      bed01e3.js   5.71 KiB                 17  [emitted] [immutable]         pages/gallery
                      c190cc4.js     77 KiB              18, 8  [emitted] [immutable]         pages/guestbook
                      c9f68b8.js  672 bytes                 12  [emitted] [immutable]         components/page-calendar-list-filter-c-categories
                      d5d4fd0.js   17.2 KiB              3, 14  [emitted] [immutable]         components/page-c-gallery
                      d8b937f.js   49.8 KiB                  1  [emitted] [immutable]         vendors/components/page-calendar-c-list/components/page-calendar-list-filter-c-categories/pages/calendar
                      d9e4b7f.js   63.6 KiB                  4  [emitted] [immutable]         vendors/components/page-calendar-c-list/pages/calendar
                      db99e5b.js    1.4 KiB                 13  [emitted] [immutable]         components/page-calendar-list-filter-c-date-range
                      ebc7943.js   2.11 KiB                 19  [emitted] [immutable]         pages/index
                      f228b74.js   5.16 KiB                  7  [emitted] [immutable]         components/page-c-contact
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]         
 + 2 hidden assets
Entrypoint app [big] = 60a1692.js 9803733.js 610c2db.js 8b28130.js

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  9803733.js (244 KiB)
  610c2db.js (1.65 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 (1.96 MiB)
      60a1692.js
      9803733.js
      610c2db.js
      8b28130.js

Hash: 2dff5396ae39be1e2c67
Version: webpack 4.46.0
Time: 37605ms
Built at: 08.07.2022 18:03:02
                                               Asset      Size             Chunks             Chunk Names
                        components/page-c-contact.js  9.97 KiB                  1  [emitted]  components/page-c-contact
                        components/page-c-gallery.js  32.6 KiB               2, 9  [emitted]  components/page-c-gallery
                      components/page-c-guestbook.js  11.2 KiB                  3  [emitted]  components/page-c-guestbook
               components/page-calendar-c-control.js  7.25 KiB                  4  [emitted]  components/page-calendar-c-control
                  components/page-calendar-c-list.js   357 KiB         5, 6, 7, 8  [emitted]  components/page-calendar-c-list
           components/page-calendar-list-c-search.js  71.7 KiB                  6  [emitted]  components/page-calendar-list-c-search
components/page-calendar-list-filter-c-categories.js   150 KiB                  7  [emitted]  components/page-calendar-list-filter-c-categories
components/page-calendar-list-filter-c-date-range.js   168 KiB                  8  [emitted]  components/page-calendar-list-filter-c-date-range
                   components/page-gallery-d-view.js  19.6 KiB                  9  [emitted]  components/page-gallery-d-view
                                   pages/calendar.js   464 KiB  10, 4, 5, 6, 7, 8  [emitted]  pages/calendar
                                    pages/contact.js  16.2 KiB              11, 1  [emitted]  pages/contact
                                    pages/gallery.js  42.6 KiB           12, 2, 9  [emitted]  pages/gallery
                                  pages/guestbook.js  94.7 KiB              13, 3  [emitted]  pages/guestbook
                                      pages/index.js  5.38 KiB                 14  [emitted]  pages/index
                                           server.js  1.17 MiB                  0  [emitted]  app
                                server.manifest.json  2.13 KiB                     [emitted]  
 + 15 hidden assets
Entrypoint app = server.js server.js.map

WARNING in ./node_modules/@nuxt/bridge/dist/runtime/composables.mjs 151:4-19
"export 'onBeforeUnmount' was not found in 'vue'
 @ ./node_modules/@nuxt/bridge/dist/runtime/index.mjs
 @ ./node_modules/@nuxt/bridge/dist/runtime/app.plugin.mjs
 @ ./.nuxt/index.js
 @ ./.nuxt/server.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/server.js
✔ You can now deploy .output/public to any static hosting!                                                                                                                  18:03:02

Process finished with exit code 0
danielroe commented 2 years ago

What is your Vue version?

MartinX3 commented 2 years ago

According to the package-lock.json it should be 2.7.4

danielroe commented 2 years ago

Would you provide a reproduction?

MartinX3 commented 2 years ago

Oh, yes of course. Here is it: reproducer.zip

warflash commented 2 years ago

I'm getting the same error on nuxi build actually without having set anything for the params you mentioned, including the flag that triggers that bug for you.

Figured I'd add that to maybe make things easier, though I'm quite new to nuxt as a whole so maybe I messed up somewhere else. It's also warning of "export 'onBeforeUnmount' was not found in 'vue-demi' which I thought was interesting.

WARNING in ./node_modules/@nuxt/bridge/dist/runtime/composables.mjs 151:4-19
"export 'onBeforeUnmount' was not found in 'vue'
 @ ./node_modules/@nuxt/bridge/dist/runtime/index.mjs
 @ ./node_modules/@nuxt/bridge/dist/runtime/app.plugin.mjs
 @ ./.nuxt/index.js
 @ ./.nuxt/server.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/server.js

WARNING in ./node_modules/@vueuse/core/node_modules/@vueuse/shared/index.mjs 823:28-43
"export 'onBeforeUnmount' was not found in 'vue-demi'
 @ ./node_modules/@vueuse/core/index.mjs
 @ ./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--35-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--37-0!./node_modules/vuetify-loader/lib/loader.js??ref--4!./node_modules/babel-loader/lib??ref--4-0!./node_modules/@nuxt/components/dist/loader.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--36-0!./components/SearchBar.vue?vue&type=script&lang=js&
 @ ./components/SearchBar.vue?vue&type=script&lang=js&
 @ ./components/SearchBar.vue
 @ ./components/AppBar.vue
 @ ./layouts/default.vue
 @ ./.nuxt/App.js
 @ ./.nuxt/index.js
 @ ./.nuxt/server.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/server.js
P4sca1 commented 2 years ago

I found this related to the onBeforeUnmount warning: https://github.com/vuejs/vue/issues/12626#issuecomment-1179171109

danielroe commented 2 years ago

Thanks - good find!

danielroe commented 2 years ago

This is now resolved in vue 2.7.5.