-
Notifications
You must be signed in to change notification settings - Fork 16
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
Carousel doesn't work in Vite (vue2)/rollup production SSR build - render function or template not defined in component: ssr-carousel #89
Comments
I tried registering the component as global, but the same error popped up. Updating deps to their newest versions to also didn't help |
Here's a repro of the issue (it's a repo, since this's build-related) |
I console logged Switching to this fixed the error you reported:
However, I'm still seeing issues: It's like the server side renderer isn't processing I haven't used vite before ... I'm not really sure where to go from here. |
I actually got undefined when trying to log the component. I think vite hands most stuff over to rollup for the build so I'd expect the issue to be with this package, vue or rollup. I will try to rebuild the carousel from source with rollup. I already tried that but hit some issues, but I'll give it another shot. |
I stand corrected. Not sure when/how I got the undefined, but the import was the invalid default as you mentioned. Anyway, I tried the carousel with a Vue-CLI/Webpack based build and that works fine |
I had to switch back to webpack, so this issue not really a problem for me now, but Evan replied to the issue I created in the vue repo with a possible solution to this. |
We're migrating our app to vite and adding SSR to it. The carousel work nicely with the dev build. However after creating the production build (
vite build --outDir dist/ssr --ssr src/entryServer.ts
), running it ('cross-env NODE_ENV=production node --experimental-specifier-resolution=node ./dist/server.cjs') and trying to view a route with a carousel fails withvue: "2.7.5",
vite: "^3.0.9"
@vitejs/plugin-vue2: "^1.1.2"
vue-ssr-carousel: "^1.4.0"
I went through the existing issue but anything related to SSR seems to be nuxt-related.
Any idea why that might be/how to fix this?
The text was updated successfully, but these errors were encountered: