player
player copied to clipboard
Build Not Work Wrangler Cloudflare
The server path does not exist this gives me a compilation error via Cloudflare Wrangler Does not work with all Vite based frameworks when ssr.noExternal is true
@vidstack/react package should not be compiled in ssr but only client side it doesn't work
Discussions:
https://github.com/vikejs/vike/discussions/2252
Environment:
- wrangler: 3.114.0
- @vidstack/react: 1.12.13
- hono: 4.7.4
- vite: 6.2.0
- vike: 0.4.224
- vike-react: 0.5.13
- vike-node: 0.3.7
- react: 19.0.0
"$exports": {
".": {
"types": "./index.d.ts",
"worker": "./server/vidstack.js",
"development": "./dev/vidstack.js",
"default": "./prod/vidstack.js"
},
"./icons": {
"types": "./icons.d.ts",
"default": "./prod/vidstack-icons.js"
},
"./player/remotion": {
"types": "./player/remotion.d.ts",
"worker": "./server/vidstack-remotion.js",
"development": "./dev/player/vidstack-remotion.js",
"default": "./prod/player/vidstack-remotion.js"
},
"./player/layouts/default": {
"types": "./player/layouts/default.d.ts",
"worker": "./server/vidstack-default-layout.js",
"development": "./dev/player/vidstack-default-layout.js",
"default": "./prod/player/vidstack-default-layout.js"
},
"./player/layouts/plyr": {
"types": "./player/layouts/plyr.d.ts",
"worker": "./server/vidstack-plyr-layout.js",
"development": "./dev/player/vidstack-plyr-layout.js",
"default": "./prod/player/vidstack-plyr-layout.js"
},
"./player/styles/*": "./player/styles/*",
"./types/*": "./types/*",
"./dom.d.ts": "./dom.d.ts",
"./google-cast.d.ts": "./google-cast.d.ts",
"./package.json": "./package.json",
"./tailwind.cjs": {
"types": "./tailwind.d.cts",
"default": "./tailwind.cjs"
},
"./analyze.json": {
"types": "./analyze.json.d.ts",
"default": "./analyze.json"
}
},
> run-s build preview:wrangler
> @ build /Users/enri/Desktop/Cloudflare Vike/my-app
> vike build
vite v6.2.1 building for production...
✓ 350 modules transformed.
dist/client/assets/static/logo.DLJJsk-H.svg 5.97 kB │ gzip: 1.71 kB
dist/client/_temp_manifest.json 15.80 kB │ gzip: 1.55 kB
dist/client/assets/static/vike-react-2d6cb19f.BcWtY8Ol.css 0.06 kB │ gzip: 0.08 kB
dist/client/assets/static/components_layouts_video-layout.BwN4VzVx.css 0.17 kB │ gzip: 0.13 kB
dist/client/assets/static/layouts_style-b34a8e57.a91n6qlS.css 0.28 kB │ gzip: 0.20 kB
dist/client/assets/static/components_layouts_captions.Cpozj9a-.css 1.44 kB │ gzip: 0.56 kB
dist/client/assets/static/layouts_tailwind-00e65532.zlxKQMV6.css 19.88 kB │ gzip: 4.45 kB
dist/client/assets/chunks/chunk-HB8yMXyK.js 0.05 kB │ gzip: 0.07 kB
dist/client/assets/chunks/chunk-CwbWEMkP.js 0.06 kB │ gzip: 0.07 kB
dist/client/assets/chunks/chunk-DMpTttaG.js 0.09 kB │ gzip: 0.10 kB
dist/client/assets/chunks/chunk-CTW6yV_7.js 0.51 kB │ gzip: 0.34 kB
dist/client/assets/chunks/chunk-C6MuSGG0.js 0.59 kB │ gzip: 0.35 kB
dist/client/assets/chunks/chunk-DDN5V1NO.js 0.71 kB │ gzip: 0.46 kB
dist/client/assets/chunks/chunk-2f5gzOW6.js 0.80 kB │ gzip: 0.50 kB
dist/client/assets/chunks/chunk-CLcXU_4U.js 0.99 kB │ gzip: 0.60 kB
dist/client/assets/chunks/chunk-DWz0WNaT.js 1.02 kB │ gzip: 0.55 kB
dist/client/assets/chunks/chunk-C-9lgksp.js 1.17 kB │ gzip: 0.38 kB
dist/client/assets/entries/pages_star-wars_-id.C83Tj1ul.js 2.45 kB │ gzip: 0.73 kB
dist/client/assets/entries/pages_error.Dv1s-31o.js 2.49 kB │ gzip: 0.74 kB
dist/client/assets/entries/pages_star-wars_index.DE6VRd-1.js 2.64 kB │ gzip: 0.82 kB
dist/client/assets/entries/pages_todo.v21KQ4Ck.js 3.30 kB │ gzip: 1.15 kB
dist/client/assets/chunks/chunk-CwYB5LJk.js 3.78 kB │ gzip: 1.70 kB
dist/client/assets/chunks/chunk-B1sBh5yP.js 4.52 kB │ gzip: 2.05 kB
dist/client/assets/chunks/chunk-DHOLPPsr.js 4.62 kB │ gzip: 1.90 kB
dist/client/assets/chunks/chunk-AOfI5Cy0.js 4.67 kB │ gzip: 2.04 kB
dist/client/assets/chunks/chunk-BB4Ux4Xa.js 6.14 kB │ gzip: 2.51 kB
dist/client/assets/chunks/chunk-D9EZf8e9.js 7.39 kB │ gzip: 2.80 kB
dist/client/assets/chunks/chunk-eAve7e0L.js 8.59 kB │ gzip: 2.97 kB
dist/client/assets/chunks/chunk-CRhx8r7R.js 17.15 kB │ gzip: 6.86 kB
dist/client/assets/entries/entry-client-routing.D8AEFSFE.js 72.93 kB │ gzip: 22.87 kB
dist/client/assets/chunks/chunk-DwEr08Hz.js 189.68 kB │ gzip: 60.38 kB
dist/client/assets/entries/pages_index.C3S26S5P.js 415.04 kB │ gzip: 125.43 kB
vite v6.2.1 building SSR bundle for production...
✓ 32 modules transformed.
dist/server/cloudflare.mjs 1.7mb ⚠️
⚡ Done in 140ms
vike-node v0.3.7 built entry: cloudflare, gzip: 290.52 kB
✗ Build failed in 293ms
[commonjs--resolver] Failed to resolve entry for package "@vidstack/react". The package may have incorrect main/module/exports specified in its package.json.
at packageEntryFailure (/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:19549:15)
at resolvePackageEntry (/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:19546:3)
at tryNodeResolve (/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:19411:18)
at Object.resolveId (/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:19184:19)
at Object.handler (/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:51698:15)
at /node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:21835:40
at PluginDriver.hookFirstAndGetPlugin (/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:21735:28)
at resolveId (/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20335:26)
at ModuleLoader.resolveId (/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20771:15)
at Object.resolveId (/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:5659:10) {
code: 'PLUGIN_ERROR',
pluginCode: 'ERR_RESOLVE_PACKAGE_ENTRY_FAIL',
plugin: 'commonjs--resolver',
hook: 'resolveId',
watchFiles: [
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import vike from "vike/plugin";
import vikeNode from 'vike-node/plugin'
export default defineConfig({
plugins: [
vike({}),
react({}),
tailwindcss(),
vikeNode({
entry: {
index: 'server/node-entry.js',
cloudflare: {
entry: 'server/app.js',
runtime: 'cloudflare-nodejs-compat',
scaffold: 'dist/cloudflare'
}
},
}),
],
optimizeDeps: {
exclude: ['@vidstack/react'],
},
ssr: {
noExternal:['@vidstack/react']
},
build: {
target: "es2022",
},
});
Hi there! Just wanted to check in and see if there are any updates on this issue, thanks in advance!
Got the same issue.