{"record":{"id":"ab5b132ac1c4290a","repo":"gatsbyjs/gatsby","slug":"uri-malformatted","errorCode":null,"errorMessage":"URI malformatted","messagePattern":"URI malformatted","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"packages/gatsby/src/commands/develop-process.ts","lineNumber":130,"sourceCode":"  const hostname = program.host\n  try {\n    program.port = await detectPortInUseAndPrompt(port, hostname)\n  } catch (e) {\n    if (e.message === `USER_REJECTED`) {\n      process.exit(0)\n    }\n\n    throw e\n  }\n\n  const app = express()\n  const parentSpan = tracer.startSpan(`bootstrap`)\n\n  app.use((req, res, next) => {\n    try {\n      decodeURIComponent(req.path)\n    } catch (e) {\n      return res.status(500).send(`URI malformatted`)\n    }\n\n    return next()\n  })\n\n  const machine = developMachine.withContext({\n    program,\n    parentSpan,\n    app,\n    reporter,\n    pendingQueryRuns: new Set([`/`]),\n    shouldRunInitialTypegen: true,\n  })\n\n  const service = interpret(machine)\n\n  if (program.verbose) {\n    logTransitions(service)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/commands/develop-process.ts#L112-L148","documentation":"develop-process installs an express middleware that decodes each request path; a URIError from decodeURIComponent means the URL contains malformed percent-encoding (e.g. a stray %), which is answered with a 500 text response instead of crashing the dev server.","triggerScenarios":"Thrown at packages/gatsby/src/commands/develop-process.ts:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix malformed percent-encoding in the requested URL","Encode dynamic path segments with encodeURIComponent before navigating"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}