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

React计算器项目无法通过freeCodeCamp测试:八进制字面量严格模式错误

React计算器项目测试报错求助

我为freeCodeCamp课程制作了一个React计算器作为期末项目,自认为满足所有要求,但无法通过测试。测试显示如下错误:

Uncaught SyntaxError: Octal literals are not allowed in strict mode. (http: //127.0.0.1:3000/:1)
Error: Uncaught SyntaxError: Octal literals are not allowed in strict mode. (http: //127.0.0.1:3000/:1)
at r.onerror (https://cdn.freecodecamp.org/testable-projects-fcc/vl/bundle.js:575:14032)
at Object. invokeGuardedCallbackDev (static/is/bundle.js: 12074:20)
at invokeGuardedCallback (static/is/bundle. js:12136:35)
at invokeGuardedCallbackAndCatchFirstError (static/is/bundle. is: 12151:29)
at executeDispatch (static/js/bundle.js: 16980:7)
at processDispatchQueueItemsInOrder(static/js/bundle.js:17012:11)
at processDispatchQueue (static/js/bundle. js:17025:9)
at dispatchEventsForPlugins (static/is/bundle. js:17036:7)
at http://127.0.0.1:3000/static/is/bundle.is:17228:16
at batchedUpdates$1 (static/js/bundle.js: 33863:16)

我是编程新手,希望得到帮助或提示以找出错误位置及修复方法。若需调试可通过npm start启动项目,GitHub仓库地址:https://github.com/JiriAU/calculator_react_v1


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.21 09:36:27