{"record":{"id":"ba1657ade2fdd80a","repo":"symfony/symfony","slug":"the-entry-s-is-not-a-remote-package","errorCode":null,"errorMessage":"The entry \"%s\" is not a remote package.","messagePattern":"The entry \"(.+?)\" is not a remote package\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Component/AssetMapper/ImportMap/RemotePackageStorage.php","lineNumber":38,"sourceCode":" */\nclass RemotePackageStorage\n{\n    private readonly Filesystem $filesystem;\n\n    public function __construct(private readonly string $vendorDir)\n    {\n        $this->filesystem = new Filesystem();\n    }\n\n    public function getStorageDir(): string\n    {\n        return $this->vendorDir;\n    }\n\n    public function isDownloaded(ImportMapEntry $entry): bool\n    {\n        if (!$entry->isRemotePackage()) {\n            throw new \\InvalidArgumentException(\\sprintf('The entry \"%s\" is not a remote package.', $entry->importName));\n        }\n\n        return is_file($this->getDownloadPath($entry->packageModuleSpecifier, $entry->type));\n    }\n\n    public function isExtraFileDownloaded(ImportMapEntry $entry, string $extraFilename): bool\n    {\n        if (!$entry->isRemotePackage()) {\n            throw new \\InvalidArgumentException(\\sprintf('The entry \"%s\" is not a remote package.', $entry->importName));\n        }\n\n        return is_file($this->getExtraFileDownloadPath($entry, $extraFilename));\n    }\n\n    public function save(ImportMapEntry $entry, string $contents): void\n    {\n        if (!$entry->isRemotePackage()) {\n            throw new \\InvalidArgumentException(\\sprintf('The entry \"%s\" is not a remote package.', $entry->importName));","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Component/AssetMapper/ImportMap/RemotePackageStorage.php#L20-L56","documentation":"RemotePackageStorage::isDownloaded() checks whether a remote package's file exists on disk and throws this InvalidArgumentException if the given ImportMapEntry is not a remote package (i.e. its version is null, meaning it is a local/path-based entry). Only remote entries have a downloadable artifact; local entries have no vendor file to check.","triggerScenarios":"Passing a local/path-based ImportMapEntry (one created without a version) to isDownloaded(). This usually stems from a bug in calling code that didn't filter entries by isRemotePackage() first.","commonSituations":"Custom code iterating all import-map entries and calling storage methods without first checking entry->isRemotePackage(). Refactoring that accidentally routes local entries into remote-storage code paths.","solutions":["Guard every call with: if ($entry->isRemotePackage()) { $storage->isDownloaded($entry); }","Filter your entry list to remote packages before passing to storage: array_filter($entries, fn($e) => $e->isRemotePackage())."],"exampleFix":"// before\nforeach ($entries as $entry) {\n    $storage->isDownloaded($entry);\n}\n// after\nforeach ($entries as $entry) {\n    if ($entry->isRemotePackage()) {\n        $storage->isDownloaded($entry);\n    }\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"if ($entry->isRemotePackage()) {\n    $exists = $storage->isDownloaded($entry);\n}","tryCatchPattern":null,"preventionTips":["Always call $entry->isRemotePackage() before any RemotePackageStorage method.","Filter entry lists to remote packages upstream of storage operations."],"tags":["asset-mapper","importmap","type-guard","remote-package"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}