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

gridsome build error #569

Open
nothinghalosix opened this issue May 8, 2021 · 4 comments
Open

gridsome build error #569

nothinghalosix opened this issue May 8, 2021 · 4 comments

Comments

@nothinghalosix
Copy link

(node:99081) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '__esModule' of undefined

at Re (/Users/nothing/sites/designfabrik/node_modules/vue/dist/vue.runtime.common.prod.js:6:24223)
at /Users/nothing/sites/designfabrik/node_modules/vue/dist/vue.runtime.common.prod.js:6:21188
at /Users/nothing/sites/designfabrik/node_modules/vue/dist/vue.runtime.common.prod.js:6:2394
@aleksanderwalczuk
Copy link

@nothinghalosix were you able to resolve this issue? I cannot build this with Gridsome

@nothinghalosix
Copy link
Author

nothinghalosix commented Sep 28, 2021

try this in your script

export default { components: { Carousel: () => import("vue-carousel") .then((m) => m.Carousel) .catch(), Slide: () => import("vue-carousel") .then((m) => m.Slide) .catch(), },

@aleksanderwalczuk
Copy link

Thanks for that, I actually solved it by setting a client only condition.

added as plugin in main.js

  if (process.isClient) {
      Vue.use(require("vue-carousel").default);
}

in template file

<ClientOnly>
  <carousel>
    <slide>slide 1</slide>
  <carousel>
</ClientOnly>

@a-kriya
Copy link

a-kriya commented Dec 2, 2021

Registering as a plugin did not work for me, but registering individual components in main.js fixed the builds for me:

if (process.isClient) {
  Vue.component('Carousel', require('vue-carousel').Carousel)
  Vue.component('Slide', require('vue-carousel').Slide)
}

In the last few days, my Gridsome builds started erroring out. I was registering per-component earlier as @nothinghalosix shared. I do not know what the difference is with registering in main.js with isClient check but it has fixed my issue.

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

3 participants