You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TYPO3 8.7.9升级至^9.5后端报错:找不到JavaScriptService类

问题描述

接手某网络代理公司的老旧TYPO3 8.7.9站点,已完成新服务器迁移,步骤如下:

  • 在www文件夹部署8.7.9版本的空Composer安装;
  • 将旧服务器public文件夹的数据复制到新服务器的public文件夹;
  • 导入数据库。

迁移完成后站点前后端均可正常使用,随后遵循官方指南通过Composer升级至^9.5版本,期间修复若干问题,安装工具无待处理升级向导任务,前端可正常访问,但后端调用时出现以下错误:

#1294585866 InvalidArgumentException
No class named TYPO3\CMS\Cshmanual\Service\JavaScriptService

当前www目录下的composer.json配置:

{"repositories": [
    { "type": "composer", "url": "https://composer.typo3.org/" }
],
"name": "typo3/cms-base-distribution",
"description" : "TYPO3 CMS Base Distribution",
"license": "GPL-2.0-or-later",
"config": {
    "allow-plugins": {
        "typo3/class-alias-loader": true,
        "typo3/cms-composer-installers": true,
        "helhum/typo3-console-plugin": true
    },
    "platform": {
        "php": "7.4"
    }
},
"require": {
    "helhum/typo3-console": "^5.5.5",
    "typo3/cms-backend": "^9.5",
    "typo3/cms-core": "^9.5",
    "typo3/cms-extbase": "^9.5",
    "typo3/cms-extensionmanager": "^9.5",
    "typo3/cms-filelist": "^9.5",
    "typo3/cms-fluid": "^9.5",
    "typo3/cms-frontend": "^9.5",
    "typo3/cms-install": "^9.5",
    "typo3/cms-recordlist": "^9.5",
    "gridelementsteam/gridelements": "^9.8",
    "georgringer/news": "^8.6",
    "evoweb/recaptcha": "^9.1",
    "friendsoftypo3/typo3db-legacy": "^1.1.1",
    "typo3/cms-adminpanel": "^9.2",
    "typo3/cms-rsaauth": "^9.5",
    "typo3fluid/fluid": "2.7.4",
    "psr/cache": "^1.0",
    "typo3/minimal": "^9.5",
    "typo3/cms-about": "^9.5",
    "typo3/cms-belog": "^9.5",
    "typo3/cms-beuser": "^9.5",
    "typo3/cms-felogin": "^9.5",
    "typo3/cms-fluid-styled-content": "^9.5",
    "typo3/cms-form": "^9.5",
    "typo3/cms-impexp": "^9.5",
    "typo3/cms-info": "^9.5",
    "typo3/cms-rte-ckeditor": "^9.5",
    "typo3/cms-scheduler": "^9.5",
    "typo3/cms-setup": "^9.5",
    "typo3/cms-sys-note": "^9.5",
    "typo3/cms-t3editor": "^9.5",
    "typo3/cms-tstemplate": "^9.5",
    "typo3/cms-viewpage": "^9.5",
    "typo3/cms-redirects": "^9.5",
    "typo3/cms-reports": "^9.5",
    "typo3/cms-seo": "^9.5",
    "typo3/cms-cshmanual": "*"
},
"scripts":{
    "typo3-cms-scripts": [
        "typo3cms install:generatepackagestates",
        "typo3cms install:fixfolderstructure"
    ],
    "post-autoload-dump": [
        "@typo3-cms-scripts"
    ]
}
}
解决方案

1. 修正typo3/cms-cshmanual版本约束

你的composer.json中typo3/cms-cshmanual使用了*作为版本号,这会导致Composer拉取与TYPO3 9.5不兼容的版本(比如10+版本),而TYPO3\CMS\Cshmanual\Service\JavaScriptService在TYPO3 9.5中已被移除或重构。

将"typo3/cms-cshmanual": "*"修改为与其他核心扩展一致的版本约束:

"typo3/cms-cshmanual": "^9.5"

2. 更新依赖并清理缓存

执行以下命令更新指定扩展并清理缓存:

# 更新cshmanual扩展及其依赖
composer update typo3/cms-cshmanual --with-dependencies
# 清空TYPO3所有缓存
typo3cms cache:flush
# 重新生成PackageStates文件
typo3cms install:generatepackagestates

3. 检查遗留代码引用

如果上述步骤无法解决问题,需要检查是否有自定义扩展、模板或配置文件在引用TYPO3\CMS\Cshmanual\Service\JavaScriptService类:

  • 搜索项目文件中是否存在该类的字符串引用;
  • 若存在,替换为TYPO3 9.5中对应的实现(Cshmanual的相关功能在9.5中已整合到后端模块,无需单独调用该服务类)。

关于迁移方式

你采用的先迁移8.7版本再升级至9.5的流程是符合官方规范的,无需更换迁移方式,问题仅出在扩展版本约束和缓存清理环节。

内容的提问来源于stack exchange,提问作者Lukas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 11:45:00