{"record":{"id":"ba3d34278cdf028f","repo":"symfony/symfony","slug":"the-path-s-of-the-entrypoint-s-mentioned-in","errorCode":null,"errorMessage":"The path \"%s\" of the entrypoint \"%s\" mentioned in \"importmap.php\" cannot be found in any asset map paths.","messagePattern":"The path \"(.+?)\" of the entrypoint \"(.+?)\" mentioned in \"importmap\\.php\" cannot be found in any asset map paths\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Component/AssetMapper/ImportMap/ImportMapGenerator.php","lineNumber":153,"sourceCode":"            return $this->compiledConfigReader->loadConfig(\\sprintf(self::ENTRYPOINT_CACHE_FILENAME_PATTERN, $entryName));\n        }\n\n        $rootImportEntries = $this->importMapConfigReader->getEntries();\n        if (!$rootImportEntries->has($entryName)) {\n            throw new \\InvalidArgumentException(\\sprintf('The entrypoint \"%s\" does not exist in \"importmap.php\".', $entryName));\n        }\n\n        if (!$rootImportEntries->get($entryName)->isEntrypoint) {\n            throw new \\InvalidArgumentException(\\sprintf('The entrypoint \"%s\" is not an entry point in \"importmap.php\". Set \"entrypoint\" => true to make it available as an entrypoint.', $entryName));\n        }\n\n        if ($rootImportEntries->get($entryName)->isRemotePackage()) {\n            throw new \\InvalidArgumentException(\\sprintf('The entrypoint \"%s\" is a remote package and cannot be used as an entrypoint.', $entryName));\n        }\n\n        $asset = $this->findAsset($rootImportEntries->get($entryName)->path);\n        if (!$asset) {\n            throw new \\InvalidArgumentException(\\sprintf('The path \"%s\" of the entrypoint \"%s\" mentioned in \"importmap.php\" cannot be found in any asset map paths.', $rootImportEntries->get($entryName)->path, $entryName));\n        }\n\n        return $this->findEagerImports($asset);\n    }\n\n    /**\n     * Adds \"implicit\" entries to the importmap.\n     *\n     * This recursively searches the dependencies of the given entry\n     * (i.e. it looks for modules imported from other modules)\n     * and adds them to the importmap.\n     *\n     * @param array<string, ImportMapEntry> $currentImportEntries\n     * @param array<string, MappedAsset>    $resolvedAssets       Filled with the asset of each expanded entry\n     *\n     * @return array<string, ImportMapEntry>\n     */\n    private function addImplicitEntries(ImportMapEntry $entry, array $currentImportEntries, array &$resolvedAssets): array","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Component/AssetMapper/ImportMap/ImportMapGenerator.php#L135-L171","documentation":"ImportMapGenerator::findEagerEntrypointImports() resolves the entrypoint's 'path' via findAsset(); if neither assetMapper->getAsset() nor getAssetFromSourcePath() finds it, InvalidArgumentException reports the path is not in any asset map path. The entrypoint exists and is flagged correctly but its file is unreachable from configured asset_mapper.paths.","triggerScenarios":"An entrypoint in importmap.php points to './assets/app.js' but 'assets' is not in asset_mapper.paths; the file was moved/deleted; the path is relative to a different root than importmap.php's directory; a typo in the path.","commonSituations":"Frontend restructure moved files out of a mapped directory; asset_mapper.paths was trimmed but importmap.php still references the old location; relative path computed against the wrong root.","solutions":["Add the directory containing the entrypoint file to framework.asset_mapper.paths in asset_mapper.yaml.","Correct the 'path' in importmap.php to point where the file actually lives (relative paths resolve against the importmap.php directory).","Run bin/console debug:asset-map to see which logical paths the mapper actually indexes.","Re-require with the correct logical path: bin/console importmap:require app=./assets/app.js --entrypoint."],"exampleFix":"# config/packages/asset_mapper.yaml - before\nframework:\n    asset_mapper:\n        paths: []   # 'assets' not mapped\n# importmap.php: 'app' => ['path' => './assets/app.js', 'entrypoint' => true]\n\n# after\nframework:\n    asset_mapper:\n        paths:\n            - '%kernel.project_dir%/assets'","handlingStrategy":"validation","validationCode":"// Confirm the entrypoint's path resolves in the asset mapper before compiling.\n$asset = $assetMapper->getAsset($entry->path)\n    ?? $assetMapper->getAssetFromSourcePath($reader->convertPathToFilesystemPath($entry->path));\nif (null === $asset) {\n    throw new \\RuntimeException('Entrypoint path '.$entry->path.' is not mapped');\n}","typeGuard":"function entrypointPathResolves(AssetMapperInterface $m, ImportMapConfigReader $r, string $name): bool {\n    $e = $r->getEntries()->get($name);\n    return null !== ($m->getAsset($e->path)\n        ?? $m->getAssetFromSourcePath($r->convertPathToFilesystemPath($e->path)));\n}","tryCatchPattern":"try {\n    $imports = $generator->findEagerEntrypointImports($name);\n} catch (\\InvalidArgumentException $e) {\n    if (str_contains($e->getMessage(), 'cannot be found in any asset map paths')) {\n        // add the dir to asset_mapper.paths or fix the path\n    } else { throw $e; }\n}","preventionTips":["Keep entrypoint files under directories listed in framework.asset_mapper.paths.","Run bin/console debug:asset-map to verify the logical path resolves.","Re-run importmap:require after moving entrypoint files."],"tags":["asset-mapper","importmap","entrypoint","filesystem","config","symfony"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}