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

Vite-ssg build error in SSR step #404

Open
5 of 7 tasks
ademtonay opened this issue May 18, 2024 · 7 comments
Open
5 of 7 tasks

Vite-ssg build error in SSR step #404

ademtonay opened this issue May 18, 2024 · 7 comments

Comments

@ademtonay
Copy link

ademtonay commented May 18, 2024

Describe the bug

I'm using vue3-carousel in my project and getting following error while building with build script.

[vite-ssg] Build for server...
vite v5.2.11 building SSR bundle for production...
Ambiguous external namespace resolution: "virtual:vue-router/auto" re-exports "useRouter" from one of the external modules "vue-router" and "unplugin-vue-router/data-loaders/basic", guessing "vue-router".
"useRouter" is imported from external module "unplugin-vue-router/data-loaders/basic" but never used in "virtual:vue-router/auto".
✓ 66 modules transformed.
✓ 0 webfont css downloaded. (0 ms, cache hit: NaN%)
.vite-ssg-temp/7un0o79hrz/manifest.webmanifest                         0.39 kB
.vite-ssg-temp/7un0o79hrz/assets/style-EG92fjKA.css                   35.60 kB
.vite-ssg-temp/7un0o79hrz/assets/route-block-mFfs_uHM.js               0.05 kB
.vite-ssg-temp/7un0o79hrz/assets/en-DrlAedJ-.js                        1.14 kB
.vite-ssg-temp/7un0o79hrz/assets/tr-BgRAO5hH.js                        1.16 kB
.vite-ssg-temp/7un0o79hrz/assets/_...all_-Emgd7hKA.js                  1.19 kB
.vite-ssg-temp/7un0o79hrz/assets/virtual_pwa-register-MFElTJ3Z.js      1.45 kB
.vite-ssg-temp/7un0o79hrz/assets/workbox-window.prod.es5-BZWEBaKl.js   8.18 kB
.vite-ssg-temp/7un0o79hrz/assets/index-BkKP3A0x.js                    43.61 kB
.vite-ssg-temp/7un0o79hrz/main.mjs                                    78.91 kB
✓ built in 452ms
file:///Users/ademtonay/Projects/kt-dent/.vite-ssg-temp/7un0o79hrz/assets/index-BkKP3A0x.js:4
import { Carousel, Navigation, Pagination, Slide } from "vue3-carousel";
         ^^^^^^^^
SyntaxError: The requested module 'vue3-carousel' does not provide an export named 'Carousel'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)

[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
file:///Users/ademtonay/Projects/kt-dent/.vite-ssg-temp/7un0o79hrz/assets/index-BkKP3A0x.js:4
import { Carousel, Navigation, Pagination, Slide } from "vue3-carousel";
         ^^^^^^^^
SyntaxError: The requested module 'vue3-carousel' does not provide an export named 'Carousel'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)

Node.js v20.13.1
 ELIFECYCLE  Command failed with exit code 1.

Reproduction

none

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 619.52 MB / 16.00 GB
    Shell: 3.6.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.13.1 - /opt/homebrew/opt/node@20/bin/node
    npm: 10.2.5 - /usr/local/bin/npm
    pnpm: 9.1.1 - ~/Projects/kt-dent/node_modules/.bin/pnpm
  Browsers:
    Chrome: 124.0.6367.209
    Safari: 17.4.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
@ninaismail
Copy link

same error here.

@ademtonay
Copy link
Author

I solved the issue by downgrade vite packages from:

   "vite": "^5.2.11",
    "vite-bundle-visualizer": "^1.2.1",
    "vite-plugin-inspect": "^0.8.4",
    "vite-plugin-pwa": "^0.20.0",
    "vite-plugin-vue-devtools": "^7.1.3",
    "vite-plugin-vue-layouts": "^0.11.0",
    "vite-plugin-webfont-dl": "^3.9.4",
    "vite-ssg": "^0.23.7",
    "vite-ssg-sitemap": "^0.6.1",
    "vitest": "^1.6.0",

to:

    "vite": "5.0.3",
    "vite-bundle-visualizer": "0.11.0",
    "vite-plugin-inspect": "0.7.42",
    "vite-plugin-pwa": "0.17.2",
    "vite-plugin-vue-devtools": "1.0.0-rc.5",
    "vite-plugin-vue-layouts": "0.8.0",
    "vite-plugin-webfont-dl": "3.9.1",
    "vite-ssg": "0.23.5",
    "vite-ssg-sitemap": "0.6.1",
    "vitest": "1.0.0-beta.6"

Note: It's just a workaround

@ninaismail
Copy link

Thank you so much it worked! @ademtonay

@jasonconsumerdirect
Copy link

I am running into the same issue except downgrading packages is not fixing it for me.

@pzj01
Copy link

pzj01 commented Aug 17, 2024

I also encountered the same problem, my vite version is 5.3.1。

@muckch
Copy link

muckch commented Aug 20, 2024

I solved the problem for me by downgrading "vue3-carousel" (from 0.3.3) by adding the following dependency:

"vue3-carousel": "0.3.1"

@ninaismail
Copy link

Hey @muckch , I'm gonna try this too thanks.

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

No branches or pull requests

5 participants