[{"data":1,"prerenderedAt":815},["ShallowReactive",2],{"docs-navigation":3,"docs-\u002Fdocs\u002Fresources\u002Ftroubleshooting":90,"docs-surround-\u002Fdocs\u002Fresources\u002Ftroubleshooting":811},[4],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Docs","\u002Fdocs","docs",[9,35,56,77],{"title":10,"path":11,"stem":12,"children":13,"page":34},"Get Started","\u002Fdocs\u002Fget-started","docs\u002F1.get-started",[14,18,22,26,30],{"title":15,"path":16,"stem":17},"Introduction","\u002Fdocs\u002Fget-started\u002Fintroduction","docs\u002F1.get-started\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fdocs\u002Fget-started\u002Fconcepts","docs\u002F1.get-started\u002F2.concepts",{"title":23,"path":24,"stem":25},"Installation","\u002Fdocs\u002Fget-started\u002Finstallation","docs\u002F1.get-started\u002F3.installation",{"title":27,"path":28,"stem":29},"Setup","\u002Fdocs\u002Fget-started\u002Fsetup","docs\u002F1.get-started\u002F4.setup",{"title":31,"path":32,"stem":33},"Maintenance","\u002Fdocs\u002Fget-started\u002Fmaintenance","docs\u002F1.get-started\u002F5.maintenance",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Usage","\u002Fdocs\u002Fusage","docs\u002F2.usage",[40,44,48,52],{"title":41,"path":42,"stem":43},"Projects","\u002Fdocs\u002Fusage\u002Fprojects","docs\u002F2.usage\u002F1.projects",{"title":45,"path":46,"stem":47},"Workflows","\u002Fdocs\u002Fusage\u002Fworkflows","docs\u002F2.usage\u002F2.workflows",{"title":49,"path":50,"stem":51},"Triggers","\u002Fdocs\u002Fusage\u002Ftriggers","docs\u002F2.usage\u002F3.triggers",{"title":53,"path":54,"stem":55},"AI Agent","\u002Fdocs\u002Fusage\u002Fagent","docs\u002F2.usage\u002F4.agent",{"title":57,"path":58,"stem":59,"children":60,"page":34},"Integrations","\u002Fdocs\u002Fintegrations","docs\u002F3.integrations",[61,65,69,73],{"title":62,"path":63,"stem":64},"GitHub","\u002Fdocs\u002Fintegrations\u002Fgithub","docs\u002F3.integrations\u002F1.github",{"title":66,"path":67,"stem":68},"Jira","\u002Fdocs\u002Fintegrations\u002Fjira","docs\u002F3.integrations\u002F2.jira",{"title":70,"path":71,"stem":72},"Plane","\u002Fdocs\u002Fintegrations\u002Fplane","docs\u002F3.integrations\u002F3.plane",{"title":74,"path":75,"stem":76},"Linear","\u002Fdocs\u002Fintegrations\u002Flinear","docs\u002F3.integrations\u002F4.linear",{"title":78,"path":79,"stem":80,"children":81,"page":34},"Resources","\u002Fdocs\u002Fresources","docs\u002F4.resources",[82,86],{"title":83,"path":84,"stem":85},"Beta Testers","\u002Fdocs\u002Fresources\u002Fbeta-testers","docs\u002F4.resources\u002F1.beta-testers",{"title":87,"path":88,"stem":89},"Troubleshooting","\u002Fdocs\u002Fresources\u002Ftroubleshooting","docs\u002F4.resources\u002F2.troubleshooting",{"id":91,"title":87,"body":92,"description":805,"extension":806,"meta":807,"navigation":808,"path":88,"seo":809,"stem":89,"__hash__":810},"docs_en\u002Fdocs\u002F4.resources\u002F2.troubleshooting.md",{"type":93,"value":94,"toc":788},"minimark",[95,112,121,126,131,150,179,185,336,340,344,359,398,407,429,442,446,450,461,480,487,522,526,530,539,555,564,584,598,602,606,614,632,651,770,784],[96,97,98,99,106,107,111],"p",{},"Most projects boot on Knecht exactly as they do with ",[100,101,105],"a",{"href":102,"rel":103},"https:\u002F\u002Fddev.com",[104],"nofollow","DDEV"," locally. If yours doesn't, check the cases below, the exceptions we have met so far. Almost all of them share one cause: Knecht routes previews by hostname on one port, while the DDEV router convention puts a dev server on the same host and another port. A Vite dev server on Knecht therefore has its own origin, handed to the project as ",[108,109,110],"code",{},"KNECHT_DEV_SERVER_URL",". Any config that builds a \"same host, other port\" address needs to read that variable instead.",[113,114,115],"note",{},[96,116,117,118,120],{},"All fixes on this page are on the project side and leave local development unchanged. ",[108,119,110],{}," is simply unset on your machine, so every fallback keeps working as before. After changing a Vite config, restart the session's dev server so the marker files are rewritten.",[122,123,125],"h2",{"id":124},"laravel","Laravel",[127,128,130],"h3",{"id":129},"vite-origin-from-ddev_primary_url","Vite Origin from DDEV_PRIMARY_URL",[96,132,133,137,138,141,142,145,146,149],{},[134,135,136],"strong",{},"Symptom."," The preview loads, but ",[108,139,140],{},"\u002F@vite\u002Fclient",", ",[108,143,144],{},"app.css",", and ",[108,147,148],{},"app.js"," fail. The tags point at the preview host on port 5173.",[96,151,152,155,156,159,160,163,164,167,168,171,172,175,176,178],{},[134,153,154],{},"Cause."," ",[108,157,158],{},"vite.config.js"," builds ",[108,161,162],{},"server.origin"," from ",[108,165,166],{},"DDEV_PRIMARY_URL"," plus ",[108,169,170],{},":5173",". The Laravel Vite plugin writes that origin into ",[108,173,174],{},"public\u002Fhot",", and Blade emits it verbatim. No value of ",[108,177,166],{}," makes \"same host, other port\" reachable on Knecht.",[96,180,181,184],{},[134,182,183],{},"Fix."," Prefer the Knecht variable and keep the DDEV branch as fallback:",[186,187,192],"pre",{"className":188,"code":189,"language":190,"meta":191,"style":191},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","server: {\n  origin: process.env.KNECHT_DEV_SERVER_URL\n    ?? (process.env.DDEV_PRIMARY_URL\n      ? `${process.env.DDEV_PRIMARY_URL.replace(\u002F:\\d+$\u002F, '')}:5173`\n      : undefined),\n},\n","js","",[108,193,194,210,233,255,316,330],{"__ignoreMap":191},[195,196,199,203,207],"span",{"class":197,"line":198},"line",1,[195,200,202],{"class":201},"sBMFI","server",[195,204,206],{"class":205},"sMK4o",":",[195,208,209],{"class":205}," {\n",[195,211,213,216,218,222,225,228,230],{"class":197,"line":212},2,[195,214,215],{"class":201},"  origin",[195,217,206],{"class":205},[195,219,221],{"class":220},"sTEyZ"," process",[195,223,224],{"class":205},".",[195,226,227],{"class":220},"env",[195,229,224],{"class":205},[195,231,232],{"class":220},"KNECHT_DEV_SERVER_URL\n",[195,234,236,239,243,246,248,250,252],{"class":197,"line":235},3,[195,237,238],{"class":205},"    ??",[195,240,242],{"class":241},"swJcz"," (",[195,244,245],{"class":220},"process",[195,247,224],{"class":205},[195,249,227],{"class":220},[195,251,224],{"class":205},[195,253,254],{"class":220},"DDEV_PRIMARY_URL\n",[195,256,258,261,264,266,268,270,272,274,276,280,283,286,290,293,297,299,302,305,308,311,313],{"class":197,"line":257},4,[195,259,260],{"class":205},"      ?",[195,262,263],{"class":205}," `${",[195,265,245],{"class":220},[195,267,224],{"class":205},[195,269,227],{"class":220},[195,271,224],{"class":205},[195,273,166],{"class":220},[195,275,224],{"class":205},[195,277,279],{"class":278},"s2Zo4","replace",[195,281,282],{"class":220},"(",[195,284,285],{"class":205},"\u002F",[195,287,289],{"class":288},"sfazB",":\\d",[195,291,292],{"class":205},"+",[195,294,296],{"class":295},"s7zQu","$",[195,298,285],{"class":205},[195,300,301],{"class":205},",",[195,303,304],{"class":205}," ''",[195,306,307],{"class":220},")",[195,309,310],{"class":205},"}",[195,312,170],{"class":288},[195,314,315],{"class":205},"`\n",[195,317,319,322,325,327],{"class":197,"line":318},5,[195,320,321],{"class":205},"      :",[195,323,324],{"class":205}," undefined",[195,326,307],{"class":241},[195,328,329],{"class":205},",\n",[195,331,333],{"class":197,"line":332},6,[195,334,335],{"class":205},"},\n",[122,337,339],{"id":338},"drupal","Drupal",[127,341,343],{"id":342},"devdist-decision-cached-too-early","Dev\u002FDist Decision Cached Too Early",[96,345,346,348,349,352,353,355,356,224],{},[134,347,136],{}," A preview with a dev server configured still loads ",[108,350,351],{},"\u002Fdist\u002Fassets\u002F...",", without ",[108,354,140],{}," or HMR. Or the tags point at ",[108,357,358],{},"http:\u002F\u002Flocalhost:5173",[96,360,361,363,364,367,368,371,372,375,376,379,380,382,383,386,387,389,390,393,394,397],{},[134,362,154],{}," The ",[108,365,366],{},"drupal\u002Fvite"," module decides between dev server and dist build in ",[108,369,370],{},"hook_library_info_alter",", so the decision is taken at ",[108,373,374],{},"drush cr"," and cached. With the default ",[108,377,378],{},"useDevServer: auto",", it probes the dev server from PHP at that moment. The boot commands run ",[108,381,374],{}," before the dev server is up, so the probe fails and \"dist\" is cached. When the probe does hit, the default ",[108,384,385],{},"devServerUrl"," of ",[108,388,358],{}," ends up in the HTML. The module also ignores Vite's ",[108,391,392],{},"base",", so a ",[108,395,396],{},"base: '\u002Fdist\u002F'"," config 404s on the dev server.",[96,399,400,402,403,406],{},[134,401,183],{}," Switch explicitly in ",[108,404,405],{},"settings.php"," when Knecht hands the URL in, no probe involved:",[186,408,412],{"className":409,"code":410,"language":411,"meta":191,"style":191},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","if ($dev = getenv('KNECHT_DEV_SERVER_URL')) {\n  $settings['vite'] = ['useDevServer' => TRUE, 'devServerUrl' => rtrim($dev, '\u002F')];\n}\n","php",[108,413,414,419,424],{"__ignoreMap":191},[195,415,416],{"class":197,"line":198},[195,417,418],{},"if ($dev = getenv('KNECHT_DEV_SERVER_URL')) {\n",[195,420,421],{"class":197,"line":212},[195,422,423],{},"  $settings['vite'] = ['useDevServer' => TRUE, 'devServerUrl' => rtrim($dev, '\u002F')];\n",[195,425,426],{"class":197,"line":235},[195,427,428],{},"}\n",[96,430,431,432,434,435,438,439,441],{},"In ",[108,433,158],{},", set the base per mode: ",[108,436,437],{},"base: command === 'serve' ? '\u002F' : '\u002Fdist\u002F'",". Run ",[108,440,374],{}," once after the change in a running session.",[122,443,445],{"id":444},"kirby","Kirby",[127,447,449],{"id":448},"dev-server-origin-defaults-to-0000","Dev Server Origin Defaults to 0.0.0.0",[96,451,452,137,454,456,457,460],{},[134,453,136],{},[108,455,140],{}," and the app's CSS and JS are requested from ",[108,458,459],{},"http:\u002F\u002F0.0.0.0:5173",", which the browser blocks.",[96,462,463,465,466,469,470,472,473,476,477,479],{},[134,464,154],{}," kirby-vite switches to the dev server as soon as a ",[108,467,468],{},".dev"," marker file exists and reads the browser-facing URL from it. vite-plugin-kirby writes that file when Vite starts, with ",[108,471,162],{}," or, when none is set, with ",[108,474,475],{},"\u003Cprotocol>:\u002F\u002F\u003Chost>:\u003Cport>",", which is ",[108,478,459],{}," for a server bound to all interfaces.",[96,481,482,484,485,206],{},[134,483,183],{}," One line in ",[108,486,158],{},[186,488,490],{"className":188,"code":489,"language":190,"meta":191,"style":191},"server: {\n  origin: process.env.KNECHT_DEV_SERVER_URL,\n},\n",[108,491,492,500,518],{"__ignoreMap":191},[195,493,494,496,498],{"class":197,"line":198},[195,495,202],{"class":201},[195,497,206],{"class":205},[195,499,209],{"class":205},[195,501,502,504,506,508,510,512,514,516],{"class":197,"line":212},[195,503,215],{"class":201},[195,505,206],{"class":205},[195,507,221],{"class":220},[195,509,224],{"class":205},[195,511,227],{"class":220},[195,513,224],{"class":205},[195,515,110],{"class":220},[195,517,329],{"class":205},[195,519,520],{"class":197,"line":235},[195,521,335],{"class":205},[122,523,525],{"id":524},"craft","Craft",[127,527,529],{"id":528},"devserverpublic-is-a-literal-ddev-url","devServerPublic Is a Literal DDEV URL",[96,531,532,534,535,538],{},[134,533,136],{}," The preview loads, but its module scripts point at ",[108,536,537],{},"https:\u002F\u002F\u003Cproject>.ddev.site:3000\u002F",", which the browser cannot reach.",[96,540,541,155,543,546,547,550,551,554],{},[134,542,154],{},[108,544,545],{},"config\u002Fvite.php"," carries the browser-facing dev server URL as a literal, the DDEV router convention. Nothing in the Craft Vite plugin derives it from the request or from env. A second gate is ",[108,548,549],{},"useDevServer",", usually ",[108,552,553],{},"CRAFT_ENVIRONMENT === 'dev'",", so that variable has to be set on Knecht too.",[96,556,557,559,560,563],{},[134,558,183],{}," Read ",[108,561,562],{},"devServerPublic"," from env with a trailing slash and keep the DDEV URL as local fallback:",[186,565,567],{"className":409,"code":566,"language":411,"meta":191,"style":191},"'devServerPublic' => App::env('KNECHT_DEV_SERVER_URL')\n    ? rtrim(App::env('KNECHT_DEV_SERVER_URL'), '\u002F') . '\u002F'\n    : 'https:\u002F\u002Fmyproject.ddev.site:3000\u002F',\n",[108,568,569,574,579],{"__ignoreMap":191},[195,570,571],{"class":197,"line":198},[195,572,573],{},"'devServerPublic' => App::env('KNECHT_DEV_SERVER_URL')\n",[195,575,576],{"class":197,"line":212},[195,577,578],{},"    ? rtrim(App::env('KNECHT_DEV_SERVER_URL'), '\u002F') . '\u002F'\n",[195,580,581],{"class":197,"line":235},[195,582,583],{},"    : 'https:\u002F\u002Fmyproject.ddev.site:3000\u002F',\n",[96,585,586,589,590,593,594,597],{},[108,587,588],{},"devServerInternal"," stays ",[108,591,592],{},"http:\u002F\u002Flocalhost:3000",", Craft probes it from PHP inside the same container. Add ",[108,595,596],{},"CRAFT_ENVIRONMENT=dev"," to the project's environment variables in Knecht.",[122,599,601],{"id":600},"custom-vite-setups","Custom Vite Setups",[127,603,605],{"id":604},"no-dev-branch-at-all","No Dev Branch at All",[96,607,608,610,611,613],{},[134,609,136],{}," The preview keeps loading ",[108,612,351],{},", or shows a \"no manifest entry\" comment, whatever the dev server does.",[96,615,616,618,619,622,623,625,626,628,629,224],{},[134,617,154],{}," A hand-rolled loader reads ",[108,620,621],{},"dist\u002F.vite\u002Fmanifest.json"," and nothing else. There is no plugin that knows about a dev server, so nothing ever emits ",[108,624,140],{},". Often the Vite config pins no port either, and a ",[108,627,396],{}," puts the dev URLs under ",[108,630,631],{},"\u002Fdist\u002F",[96,633,634,636,637,639,640,643,644,647,648,650],{},[134,635,183],{}," Branch in the loader: when ",[108,638,110],{}," is set, emit the HMR client once plus a ",[108,641,642],{},"\u003Clink>"," and a ",[108,645,646],{},"\u003Cscript type=\"module\">"," for the entry from that origin, otherwise the manifest path as before. In ",[108,649,158],{},", pin the port and serve from the root in dev mode:",[186,652,654],{"className":188,"code":653,"language":190,"meta":191,"style":191},"export default defineConfig(({ command }) => ({\n  base: command === 'serve' ? '\u002F' : '\u002Fdist\u002F',\n  server: { port: 5173, strictPort: true },\n}))\n",[108,655,656,688,730,763],{"__ignoreMap":191},[195,657,658,661,664,667,669,672,676,679,683,685],{"class":197,"line":198},[195,659,660],{"class":295},"export",[195,662,663],{"class":295}," default",[195,665,666],{"class":278}," defineConfig",[195,668,282],{"class":220},[195,670,671],{"class":205},"({",[195,673,675],{"class":674},"sHdIc"," command",[195,677,678],{"class":205}," })",[195,680,682],{"class":681},"spNyl"," =>",[195,684,242],{"class":220},[195,686,687],{"class":205},"{\n",[195,689,690,693,695,698,701,704,707,710,713,715,717,719,722,724,726,728],{"class":197,"line":212},[195,691,692],{"class":241},"  base",[195,694,206],{"class":205},[195,696,697],{"class":220}," command ",[195,699,700],{"class":205},"===",[195,702,703],{"class":205}," '",[195,705,706],{"class":288},"serve",[195,708,709],{"class":205},"'",[195,711,712],{"class":205}," ?",[195,714,703],{"class":205},[195,716,285],{"class":288},[195,718,709],{"class":205},[195,720,721],{"class":205}," :",[195,723,703],{"class":205},[195,725,631],{"class":288},[195,727,709],{"class":205},[195,729,329],{"class":205},[195,731,732,735,737,740,743,745,749,751,754,756,760],{"class":197,"line":235},[195,733,734],{"class":241},"  server",[195,736,206],{"class":205},[195,738,739],{"class":205}," {",[195,741,742],{"class":241}," port",[195,744,206],{"class":205},[195,746,748],{"class":747},"sbssI"," 5173",[195,750,301],{"class":205},[195,752,753],{"class":241}," strictPort",[195,755,206],{"class":205},[195,757,759],{"class":758},"sfNiH"," true",[195,761,762],{"class":205}," },\n",[195,764,765,767],{"class":197,"line":257},[195,766,310],{"class":205},[195,768,769],{"class":220},"))\n",[96,771,772,773,778,779,783],{},"Hit a project that behaves differently from your local setup and is not listed here? Tell us on ",[100,774,777],{"href":775,"rel":776},"https:\u002F\u002Fdiscord.gg\u002FWuxjmtgUyX",[104],"Discord"," or at ",[100,780,782],{"href":781},"mailto:hallo@knecht.works","hallo@knecht.works",", ideally with the symptom and the relevant config file.",[785,786,787],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":191,"searchDepth":212,"depth":212,"links":789},[790,793,796,799,802],{"id":124,"depth":212,"text":125,"children":791},[792],{"id":129,"depth":235,"text":130},{"id":338,"depth":212,"text":339,"children":794},[795],{"id":342,"depth":235,"text":343},{"id":444,"depth":212,"text":445,"children":797},[798],{"id":448,"depth":235,"text":449},{"id":524,"depth":212,"text":525,"children":800},[801],{"id":528,"depth":235,"text":529},{"id":600,"depth":212,"text":601,"children":803},[804],{"id":604,"depth":235,"text":605},"Fix the differences a project can show on Knecht compared to your local DDEV setup.","md",{},true,{"title":87,"description":805},"b06zaY6UZJ0lP-t0n6GyuXJ2zPEm8hMfEb2LTpknurI",[812,814],{"title":83,"path":84,"stem":85,"description":813,"children":-1},"How to get your instance, set it up, and redeem your OpenCode credit.",null,1790265017026]