UI 看起来与部署的网站不同
UI looks different from the deployed website
我是一名初级前端开发人员。我最近为开源克隆了一个 github 存储库(抱歉无法提供 link)并使用 docker 运行 它。当我在本地主机上加载 UI 时,只显示已部署网站上的一些功能,但是当我在 chrome 上使用开发人员工具时,没有错误,控制台中也没有任何内容。当我点击主页上显示的 linked the following error popped up for a few seconds 并再次检查控制台时,我看到以下错误
route-loader.js?361d:91 GET http://localhost:3000/_next/static/chunks/pages/%5Bslug%5D.js net::ERR_ABORTED 404 (Not Found)
eval @ route-loader.js:113
appendScript @ route-loader.js:96
maybeExecuteScript @ route-loader.js:210
eval @ route-loader.js:267
Promise.then (async)
eval @ route-loader.js:264
withFuture @ route-loader.js:47
loadRoute @ route-loader.js:263
loadPage @ page-loader.js:126
_callee5$ @ router.js:1381
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
fetchComponent @ router.js:1411
_callee3$ @ router.js:1098
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
getRouteInfo @ router.js:1166
_callee$ @ router.js:791
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
change @ router.js:921
push @ router.js:533
instance.<computed> @ router.js:167
linkClicked @ link.js:67
onClick @ link.js:233
callCallback @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4070
executeDispatch @ react-dom.development.js:8243
processDispatchQueueItemsInOrder @ react-dom.development.js:8275
processDispatchQueue @ react-dom.development.js:8288
dispatchEventsForPlugins @ react-dom.development.js:8299
eval @ react-dom.development.js:8508
batchedEventUpdates @ react-dom.development.js:22391
batchedEventUpdates @ react-dom.development.js:3745
dispatchEventForPluginEventSystem @ react-dom.development.js:8507
attemptToDispatchEvent @ react-dom.development.js:6005
dispatchEvent @ react-dom.development.js:5924
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority @ react-dom.development.js:11276
discreteUpdates @ react-dom.development.js:22408
discreteUpdates @ react-dom.development.js:3756
dispatchDiscreteEvent @ react-dom.development.js:5889
route-loader.js:104 Uncaught (in promise) Error: Failed to load script: /_next/static/chunks/pages/%5Bslug%5D.js
at HTMLScriptElement.script.onerror (route-loader.js:104:36)
script.onerror @ route-loader.js:104
error (async)
eval @ route-loader.js:103
appendScript @ route-loader.js:96
maybeExecuteScript @ route-loader.js:210
eval @ route-loader.js:267
Promise.then (async)
eval @ route-loader.js:264
withFuture @ route-loader.js:47
loadRoute @ route-loader.js:263
loadPage @ page-loader.js:126
_callee5$ @ router.js:1381
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
fetchComponent @ router.js:1411
_callee3$ @ router.js:1098
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
getRouteInfo @ router.js:1166
_callee$ @ router.js:791
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
change @ router.js:921
push @ router.js:533
instance.<computed> @ router.js:167
linkClicked @ link.js:67
onClick @ link.js:233
callCallback @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4070
executeDispatch @ react-dom.development.js:8243
processDispatchQueueItemsInOrder @ react-dom.development.js:8275
processDispatchQueue @ react-dom.development.js:8288
dispatchEventsForPlugins @ react-dom.development.js:8299
eval @ react-dom.development.js:8508
batchedEventUpdates @ react-dom.development.js:22391
batchedEventUpdates @ react-dom.development.js:3745
dispatchEventForPluginEventSystem @ react-dom.development.js:8507
attemptToDispatchEvent @ react-dom.development.js:6005
dispatchEvent @ react-dom.development.js:5924
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority @ react-dom.development.js:11276
discreteUpdates @ react-dom.development.js:22408
discreteUpdates @ react-dom.development.js:3756
dispatchDiscreteEvent @ react-dom.development.js:5889
Navigated to http://localhost:3000/bush-point
抱歉,如果这含糊不清,但可能是什么问题?我很乐意提供更多信息,只要它不会泄露开源代码库是什么。或者,欢迎任何调试建议!
编辑:
我按照目录 _next/static/chunks/pages 并没有看到 [slug].js 文件:
my directory
编辑2:
我的页面看起来像 this when it should look like this
您似乎已将其中一个 pages/
文件命名为 [slug].js
(或者至少这是它的评估目的 - 请参阅 %5Bslug%5D
如果没有,post 页面目录的内容。
解决:重命名文件或删除相应文件并重新运行构建。
我是一名初级前端开发人员。我最近为开源克隆了一个 github 存储库(抱歉无法提供 link)并使用 docker 运行 它。当我在本地主机上加载 UI 时,只显示已部署网站上的一些功能,但是当我在 chrome 上使用开发人员工具时,没有错误,控制台中也没有任何内容。当我点击主页上显示的 linked the following error popped up for a few seconds 并再次检查控制台时,我看到以下错误
route-loader.js?361d:91 GET http://localhost:3000/_next/static/chunks/pages/%5Bslug%5D.js net::ERR_ABORTED 404 (Not Found)
eval @ route-loader.js:113
appendScript @ route-loader.js:96
maybeExecuteScript @ route-loader.js:210
eval @ route-loader.js:267
Promise.then (async)
eval @ route-loader.js:264
withFuture @ route-loader.js:47
loadRoute @ route-loader.js:263
loadPage @ page-loader.js:126
_callee5$ @ router.js:1381
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
fetchComponent @ router.js:1411
_callee3$ @ router.js:1098
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
getRouteInfo @ router.js:1166
_callee$ @ router.js:791
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
change @ router.js:921
push @ router.js:533
instance.<computed> @ router.js:167
linkClicked @ link.js:67
onClick @ link.js:233
callCallback @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4070
executeDispatch @ react-dom.development.js:8243
processDispatchQueueItemsInOrder @ react-dom.development.js:8275
processDispatchQueue @ react-dom.development.js:8288
dispatchEventsForPlugins @ react-dom.development.js:8299
eval @ react-dom.development.js:8508
batchedEventUpdates @ react-dom.development.js:22391
batchedEventUpdates @ react-dom.development.js:3745
dispatchEventForPluginEventSystem @ react-dom.development.js:8507
attemptToDispatchEvent @ react-dom.development.js:6005
dispatchEvent @ react-dom.development.js:5924
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority @ react-dom.development.js:11276
discreteUpdates @ react-dom.development.js:22408
discreteUpdates @ react-dom.development.js:3756
dispatchDiscreteEvent @ react-dom.development.js:5889
route-loader.js:104 Uncaught (in promise) Error: Failed to load script: /_next/static/chunks/pages/%5Bslug%5D.js
at HTMLScriptElement.script.onerror (route-loader.js:104:36)
script.onerror @ route-loader.js:104
error (async)
eval @ route-loader.js:103
appendScript @ route-loader.js:96
maybeExecuteScript @ route-loader.js:210
eval @ route-loader.js:267
Promise.then (async)
eval @ route-loader.js:264
withFuture @ route-loader.js:47
loadRoute @ route-loader.js:263
loadPage @ page-loader.js:126
_callee5$ @ router.js:1381
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
fetchComponent @ router.js:1411
_callee3$ @ router.js:1098
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
getRouteInfo @ router.js:1166
_callee$ @ router.js:791
tryCatch @ runtime.js:63
invoke @ runtime.js:294
eval @ runtime.js:119
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
change @ router.js:921
push @ router.js:533
instance.<computed> @ router.js:167
linkClicked @ link.js:67
onClick @ link.js:233
callCallback @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4070
executeDispatch @ react-dom.development.js:8243
processDispatchQueueItemsInOrder @ react-dom.development.js:8275
processDispatchQueue @ react-dom.development.js:8288
dispatchEventsForPlugins @ react-dom.development.js:8299
eval @ react-dom.development.js:8508
batchedEventUpdates @ react-dom.development.js:22391
batchedEventUpdates @ react-dom.development.js:3745
dispatchEventForPluginEventSystem @ react-dom.development.js:8507
attemptToDispatchEvent @ react-dom.development.js:6005
dispatchEvent @ react-dom.development.js:5924
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority @ react-dom.development.js:11276
discreteUpdates @ react-dom.development.js:22408
discreteUpdates @ react-dom.development.js:3756
dispatchDiscreteEvent @ react-dom.development.js:5889
Navigated to http://localhost:3000/bush-point
抱歉,如果这含糊不清,但可能是什么问题?我很乐意提供更多信息,只要它不会泄露开源代码库是什么。或者,欢迎任何调试建议!
编辑: 我按照目录 _next/static/chunks/pages 并没有看到 [slug].js 文件: my directory
编辑2: 我的页面看起来像 this when it should look like this
您似乎已将其中一个 pages/
文件命名为 [slug].js
(或者至少这是它的评估目的 - 请参阅 %5Bslug%5D
如果没有,post 页面目录的内容。
解决:重命名文件或删除相应文件并重新运行构建。