gatsbyjs/gatsby · error

gatsby-source-filesystem_10001

gatsby-source-filesystem_10001

Error message

error copying file from ${details.absolutePath} to ${publicPath}

What it means

extend-file-node's publicURL-style resolver copies the source file into public/static/<contentDigest>/ on first request; this panic fires from the copy callback when fs.copySync reports an error (permissions, missing source, disk issue) while copying details.absolutePath to publicPath.

Solutions

  1. Check the source file exists and is readable at the absolute path
  2. Fix filesystem permissions/disk space in public/static
  3. Clear public/ and rebuild to retry the copy
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/gatsby-source-filesystem/src/extend-file-node.js:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/70961bd826cd999a. Report an issue: GitHub.

Appendix: source

Thrown at packages/gatsby-source-filesystem/src/extend-file-node.js:39

      resolve: (file, fieldArgs, context) => {
        const details = getNodeAndSavePathDependency(file.id, context.path)
        const fileName = `${file.internal.contentDigest}/${details.base}`

        const publicPath = path.join(
          process.cwd(),
          `public`,
          `static`,
          fileName
        )

        if (!fs.existsSync(publicPath)) {
          fs.copySync(
            details.absolutePath,
            publicPath,
            { dereference: true },
            err => {
              if (err) {
                reporter.panic(
                  {
                    id: prefixId(CODES.MissingResource),
                    context: {
                      sourceMessage: `error copying file from ${details.absolutePath} to ${publicPath}`,
                    },
                  },
                  err
                )
              }
            }
          )
        }

        return `${pathPrefix}/static/${fileName}`
      },
    },
  }
}

View on GitHub (pinned to e85d62f177)