{"record":{"id":"3fe075bc6e8fe831","repo":"dianping/cat","slug":"failed-to-require-name","errorCode":null,"errorMessage":"failed to require \"{name}\"","messagePattern":"failed to require \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js","lineNumber":14,"sourceCode":"\n;(function(){\n\n/**\n * Require the module at `name`.\n *\n * @param {String} name\n * @return {Object} exports\n * @api public\n */\n\nfunction require(name) {\n  var module = require.modules[name];\n  if (!module) throw new Error('failed to require \"' + name + '\"');\n\n  if (!('exports' in module) && typeof module.definition === 'function') {\n    module.client = module.component = true;\n    module.definition.call(this, module.exports = {}, module);\n    delete module.definition;\n  }\n\n  return module.exports;\n}\n\n/**\n * Registered modules.\n */\n\nrequire.modules = {};\n\n/**\n * Register module at `name` with callback `definition`.","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js#L1-L32","documentation":"dropzone.js is built with the (old) component module system: each internal file is registered in require.modules and require(name) looks it up. This throw means a module name was required that was never registered — i.e. the dropzone build/bundle is incomplete or was altered. It is essentially an internal integrity check, not a normal user-facing API error.","triggerScenarios":"Loading a truncated or hand-edited dropzone.js where some require.modules[...] registrations are missing; re-packaging dropzone with a bundler that drops internal module registrations; calling the internal require() directly with a wrong name.","commonSituations":"Custom/minified rebuilds of dropzone 3.x/4.x that strip the component wrapper; concatenating only part of the dropzone source into a combined assets file (as this webapp does with uncompressed assets).","solutions":["Replace the altered/truncated file with the official dropzone.js build from the same version.","If concatenating assets, include the entire dropzone file unmodified.","Do not call Dropzone's internal require() from application code — use the public Dropzone API."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (typeof window.Dropzone === 'undefined') {\n  console.error('dropzone.js failed to load intact (internal modules missing). Re-place the file with the official build.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  new Dropzone(el, { url: '/upload' });\n} catch (e) {\n  if (/failed to require/.test(e.message)) {\n    logAssetError('dropzone.js build is truncated — replace with official build', e);\n  } else { throw e; }\n}","preventionTips":["Never hand-edit or partially concatenate dropzone.js; ship the official file.","Smoke-test uploads after any change to the asset pipeline.","Pin the dropzone version and verify checksum/file size on deploy."],"tags":["dropzone","build","vendor","internal-error"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}