remix-run/remix · error · AssetServerCompilationError

FILE_NOT_SUPPORTED

FILE_NOT_SUPPORTED

Error message

File type is not supported: ${identityPath}

What it means

The asset server's URL resolver tried to compute a served URL for a file but no file compiler is configured, meaning this asset type cannot be compiled or served (e.g. requesting a non-script/static-only mode). It throws a compilation error with code FILE_NOT_SUPPORTED.

Source

Thrown at packages/assets/src/lib/asset-server.ts:458

      watcher.updateWatchedDirectories(delta)
    },
    onWatchFilesChange: (delta) => {
      updateBrowserHmrWatchedFiles(delta)
    },
    rootDir: resolvedOptions.rootDir,
    routes: resolvedOptions.routes,
    sourceMapSourcePaths: resolvedOptions.sourceMapSourcePaths,
    sourceMaps: resolvedOptions.sourceMaps,
    target: resolvedOptions.scriptsTarget,
    watchIgnore: resolvedOptions.watchOptions?.ignore,
    watchMode: resolvedOptions.watchOptions !== null,
  })
  let styleCompiler = createStyleCompiler({
    buildId: resolvedOptions.buildId,
    fingerprintAssets: resolvedOptions.fingerprintAssets,
    getServedFileUrl: (identityPath: string, options: { transform: readonly string[] | null }) => {
      if (!fileCompiler) {
        throw createAssetServerCompilationError(`File type is not supported: ${identityPath}`, {
          code: 'FILE_NOT_SUPPORTED',
        })
      }

      if (options.transform !== null) {
        fileCompiler.validateTransformQuery(options.transform)
      }

      return fileCompiler.getHref(identityPath, { transform: options.transform })
    },
    hmr: sendHmrPayload
      ? {
          send(pathname, timestamp) {
            sendHmrPayload({
              timestamp,
              type: 'browser:update',
              updates: [
                {

View on GitHub (pinned to 9696913134)

Solutions

  1. Configure the asset server with the appropriate file compiler for the file types you serve
  2. Only request served URLs for file types the server is configured to compile
  3. Serve truly static files via the static file path instead of the compiler path
Defensive patterns

Strategy: validation

Validate before calling

if (!serverSupportsFileType(identityPath)) throw new Error('configure a file compiler first')

Type guard

const isCompilablePath = (p: string) => /\.(ts|tsx|js|jsx|css|scss)$/.test(p)

Try / catch

try { url = getServedFileUrl(path) } catch (e) { if (e.code === 'FILE_NOT_SUPPORTED') fallbackToStatic(path) else throw e }

Prevention

When it happens

Trigger: Calling getServedFileUrl for a file when the asset server was created without a fileCompiler (for example a styles-only or scripts-only configuration), or asking it to serve a file type outside the configured compilers.

Common situations: Custom asset server setups that omit file compiler options but still reference files that need compilation; referencing source files (e.g. .ts/.tsx) from contexts where only static asset serving is enabled.

Related errors


AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27). Data as JSON: /api/errors/69116c0edda8fd66. Report an issue: GitHub.