{"record":{"id":"5bbde40d87f327bc","repo":"FuelLabs/fuels-ts","slug":"parse-failed-5bbde4","errorCode":"PARSE_FAILED","errorMessage":"Unable to find package.json at ${inlinePackageJsonPath} or ${relativeBinPackageJsonPath}","messagePattern":"Unable to find package\\.json at (.+?) or (.+?)","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"info","filePath":"packages/create-fuels/src/lib/getPackageVersion.ts","lineNumber":29,"sourceCode":" */\nexport const getPackageVersion = (args: string[]): string => {\n  const [, execPath] = args;\n\n  const basePath = dirname(execPath);\n  // PNPM resolves to `node_modules/create-fuels/create-fuels.js`\n  const inlinePackageJsonPath = join(basePath, 'package.json');\n  // Bun resolves to `node_modules/.bin/create-fuels`\n  const relativeBinPackageJsonPath = join(basePath, '..', 'create-fuels', 'package.json');\n\n  let version: string;\n  try {\n    let path;\n    if (existsSync(inlinePackageJsonPath)) {\n      path = inlinePackageJsonPath;\n    } else if (existsSync(relativeBinPackageJsonPath)) {\n      path = relativeBinPackageJsonPath;\n    } else {\n      throw new FuelError(\n        FuelError.CODES.PARSE_FAILED,\n        `Unable to find package.json at ${inlinePackageJsonPath} or ${relativeBinPackageJsonPath}`\n      );\n    }\n\n    const packageJson = readFileSync(path, 'utf8');\n    version = JSON.parse(packageJson).version;\n  } catch (error) {\n    version = versions.FUELS;\n  }\n\n  return version;\n};\n","sourceCodeStart":11,"sourceCodeEnd":43,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/create-fuels/src/lib/getPackageVersion.ts#L11-L43","documentation":"Declared in getPackageVersion() (packages/create-fuels/src/lib/getPackageVersion.ts:29) when neither the inline package.json path (for PNPM resolution) nor the relative bin package.json path (for Bun resolution) exists on disk. IMPORTANT: this throw lives inside a try block (line 22) whose catch (line 37) silently falls back to versions.FUELS. Callers therefore never observe this error — they always receive a version string. It is documented here for completeness.","triggerScenarios":"Running the create-fuels CLI in an environment where the package.json is not discoverable at either the expected PNPM path (node_modules/create-fuels/package.json) or Bun path (node_modules/.bin/../create-fuels/package.json). The error is caught and the function returns versions.FUELS instead.","commonSituations":"Running create-fuels via an unconventional package manager or resolution strategy; running from a global install where node_modules layout differs; symlinked or monorepo setups that relocate the package.json; Bun vs PNPM vs Yarn PPR resolution differences.","solutions":["This error is handled internally — no action needed. The function falls back to versions.FUELS.","If the fallback version is incorrect, verify the create-fuels package is installed properly: npm ls create-fuels or check node_modules.","Reinstall the package with the intended package manager to ensure correct node_modules layout."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["This error is caught internally and never surfaces to callers — the function always returns a version string.","If the returned version is incorrect (always versions.FUELS), verify create-fuels is installed correctly.","Use the same package manager consistently to avoid node_modules layout differences between PNPM and Bun."],"tags":["create-fuels","package-resolution","masked-error","cli","fallback"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}