Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUN-8 Reimplement assignment builder page #593

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

morozov-av
Copy link
Contributor

  1. A new page is available at /assignment/instructor/builderV2.
  2. Some functionality might be missing, but at the same time, many noticeable improvements have been made.
  3. The PR is unbearably large; I won't allow such a situation to happen again. We’ll break the work into smaller tasks and close them gradually.
  4. Before merging, I kindly ask you to run my branch locally and verify that everything builds and runs correctly on your side (unlikely, but TypeScript might require additional configuration).

As always, I’m happy to address any questions or comments!

@morozov-av morozov-av requested a review from bnmnetp as a code owner December 9, 2024 19:49
@bnmnetp
Copy link
Member

bnmnetp commented Dec 13, 2024

Trying to test this locally I get this error about Uncaught Error: You cannot render a <Router> inside another <Router>. Maybe I missed something and I need to configure differently? I get this from a npm start as well as when I build it and try to access the page through docker.

VM19:1 Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
Promise.then
(anonymous) @ (index):61
App.tsx:95 ENV:  {BASE_URL: '/', DEV: true, MODE: 'development', PROD: false, SSR: false, …}
react-router-dom.js?v=258e423b:1192 Uncaught Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app.
    at invariant (react-router-dom.js?v=258e423b:1192:11)
    at Router (react-router-dom.js?v=258e423b:6040:3)
    at renderWithHooks (chunk-YZVM2MHU.js?v=d88510ea:11548:26)
    at mountIndeterminateComponent (chunk-YZVM2MHU.js?v=d88510ea:14926:21)
    at beginWork (chunk-YZVM2MHU.js?v=d88510ea:15914:22)
    at HTMLUnknownElement.callCallback2 (chunk-YZVM2MHU.js?v=d88510ea:3674:22)
    at Object.invokeGuardedCallbackDev (chunk-YZVM2MHU.js?v=d88510ea:3699:24)
    at invokeGuardedCallback (chunk-YZVM2MHU.js?v=d88510ea:3733:39)
    at beginWork$1 (chunk-YZVM2MHU.js?v=d88510ea:19765:15)
    at performUnitOfWork (chunk-YZVM2MHU.js?v=d88510ea:19198:20)
invariant @ react-router-dom.js?v=258e423b:1192
Router @ react-router-dom.js?v=258e423b:6040
renderWithHooks @ chunk-YZVM2MHU.js?v=d88510ea:11548
mountIndeterminateComponent @ chunk-YZVM2MHU.js?v=d88510ea:14926
beginWork @ chunk-YZVM2MHU.js?v=d88510ea:15914
callCallback2 @ chunk-YZVM2MHU.js?v=d88510ea:3674
invokeGuardedCallbackDev @ chunk-YZVM2MHU.js?v=d88510ea:3699
invokeGuardedCallback @ chunk-YZVM2MHU.js?v=d88510ea:3733
beginWork$1 @ chunk-YZVM2MHU.js?v=d88510ea:19765
performUnitOfWork @ chunk-YZVM2MHU.js?v=d88510ea:19198
workLoopSync @ chunk-YZVM2MHU.js?v=d88510ea:19137
renderRootSync @ chunk-YZVM2MHU.js?v=d88510ea:19116
performConcurrentWorkOnRoot @ chunk-YZVM2MHU.js?v=d88510ea:18678
workLoop @ chunk-YZVM2MHU.js?v=d88510ea:197
flushWork @ chunk-YZVM2MHU.js?v=d88510ea:176
performWorkUntilDeadline @ chunk-YZVM2MHU.js?v=d88510ea:384
Show 16 more frames
Show less
App.tsx:95 ENV:  {BASE_URL: '/', DEV: true, MODE: 'development', PROD: false, SSR: false, …}BASE_URL: "/"DEV: trueMODE: "development"PROD: falseSSR: falseVITE_BASE_URL: "/"VITE_LOAD_PREFIX: "/runestone"[[Prototype]]: Object
react-router-dom.js?v=258e423b:1192 Uncaught Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app.
    at invariant (react-router-dom.js?v=258e423b:1192:11)
    at Router (react-router-dom.js?v=258e423b:6040:3)
    at renderWithHooks (chunk-YZVM2MHU.js?v=d88510ea:11548:26)
    at mountIndeterminateComponent (chunk-YZVM2MHU.js?v=d88510ea:14926:21)
    at beginWork (chunk-YZVM2MHU.js?v=d88510ea:15914:22)
    at HTMLUnknownElement.callCallback2 (chunk-YZVM2MHU.js?v=d88510ea:3674:22)
    at Object.invokeGuardedCallbackDev (chunk-YZVM2MHU.js?v=d88510ea:3699:24)
    at invokeGuardedCallback (chunk-YZVM2MHU.js?v=d88510ea:3733:39)
    at beginWork$1 (chunk-YZVM2MHU.js?v=d88510ea:19765:15)
    at performUnitOfWork (chunk-YZVM2MHU.js?v=d88510ea:19198:20)
invariant @ react-router-dom.js?v=258e423b:1192
Router @ react-router-dom.js?v=258e423b:6040
renderWithHooks @ chunk-YZVM2MHU.js?v=d88510ea:11548
mountIndeterminateComponent @ chunk-YZVM2MHU.js?v=d88510ea:14926
beginWork @ chunk-YZVM2MHU.js?v=d88510ea:15914
callCallback2 @ chunk-YZVM2MHU.js?v=d88510ea:3674
invokeGuardedCallbackDev @ chunk-YZVM2MHU.js?v=d88510ea:3699
invokeGuardedCallback @ chunk-YZVM2MHU.js?v=d88510ea:3733
beginWork$1 @ chunk-YZVM2MHU.js?v=d88510ea:19765
performUnitOfWork @ chunk-YZVM2MHU.js?v=d88510ea:19198
workLoopSync @ chunk-YZVM2MHU.js?v=d88510ea:19137
renderRootSync @ chunk-YZVM2MHU.js?v=d88510ea:19116
recoverFromConcurrentError @ chunk-YZVM2MHU.js?v=d88510ea:18736
performConcurrentWorkOnRoot @ chunk-YZVM2MHU.js?v=d88510ea:18684
workLoop @ chunk-YZVM2MHU.js?v=d88510ea:197
flushWork @ chunk-YZVM2MHU.js?v=d88510ea:176
performWorkUntilDeadline @ chunk-YZVM2MHU.js?v=d88510ea:384
Show 17 more frames
Show less
hook.js:608 The above error occurred in the <Router> component:

    at Router (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=258e423b:6033:13)
    at RouterProvider (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=258e423b:5778:11)
    at RouterProvider2
    at div
    at div
    at div
    at ToastContextProvider (http://localhost:5173/src/components/ui/ToastContext.tsx:26:40)
    at Router (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=258e423b:6033:13)
    at BrowserRouter (http://localhost:5173/node_modules/.vite/deps/react-router-dom.js?v=258e423b:8072:3)
    at App (http://localhost:5173/src/App.tsx:143:7)
    at PrimeReactProvider2 (http://localhost:5173/node_modules/.vite/deps/chunk-BZF5RPID.js?v=d88510ea:3604:26)
    at Provider (http://localhost:5173/node_modules/.vite/deps/chunk-FEKAUZFZ.js?v=d88510ea:1097:3)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
overrideMethod @ hook.js:608
logCapturedError @ chunk-YZVM2MHU.js?v=d88510ea:14032
update.callback @ chunk-YZVM2MHU.js?v=d88510ea:14052
callCallback @ chunk-YZVM2MHU.js?v=d88510ea:11248
commitUpdateQueue @ chunk-YZVM2MHU.js?v=d88510ea:11265
commitLayoutEffectOnFiber @ chunk-YZVM2MHU.js?v=d88510ea:17093
commitLayoutMountEffects_complete @ chunk-YZVM2MHU.js?v=d88510ea:17980
commitLayoutEffects_begin @ chunk-YZVM2MHU.js?v=d88510ea:17969
commitLayoutEffects @ chunk-YZVM2MHU.js?v=d88510ea:17920
commitRootImpl @ chunk-YZVM2MHU.js?v=d88510ea:19353
commitRoot @ chunk-YZVM2MHU.js?v=d88510ea:19277
finishConcurrentRender @ chunk-YZVM2MHU.js?v=d88510ea:18760
performConcurrentWorkOnRoot @ chunk-YZVM2MHU.js?v=d88510ea:18718
workLoop @ chunk-YZVM2MHU.js?v=d88510ea:197
flushWork @ chunk-YZVM2MHU.js?v=d88510ea:176
performWorkUntilDeadline @ chunk-YZVM2MHU.js?v=d88510ea:384
Show 16 more frames
Show less
chunk-YZVM2MHU.js?v=d88510ea:19413 Uncaught Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app.
    at invariant (react-router-dom.js?v=258e423b:1192:11)
    at Router (react-router-dom.js?v=258e423b:6040:3)
    at renderWithHooks (chunk-YZVM2MHU.js?v=d88510ea:11548:26)
    at mountIndeterminateComponent (chunk-YZVM2MHU.js?v=d88510ea:14926:21)
    at beginWork (chunk-YZVM2MHU.js?v=d88510ea:15914:22)
    at beginWork$1 (chunk-YZVM2MHU.js?v=d88510ea:19753:22)
    at performUnitOfWork (chunk-YZVM2MHU.js?v=d88510ea:19198:20)
    at workLoopSync (chunk-YZVM2MHU.js?v=d88510ea:19137:13)
    at renderRootSync (chunk-YZVM2MHU.js?v=d88510ea:19116:15)
    at recoverFromConcurrentError (chunk-YZVM2MHU.js?v=d88510ea:18736:28)
invariant @ react-router-dom.js?v=258e423b:1192
Router @ react-router-dom.js?v=258e423b:6040
renderWithHooks @ chunk-YZVM2MHU.js?v=d88510ea:11548
mountIndeterminateComponent @ chunk-YZVM2MHU.js?v=d88510ea:14926
beginWork @ chunk-YZVM2MHU.js?v=d88510ea:15914
beginWork$1 @ chunk-YZVM2MHU.js?v=d88510ea:19753
performUnitOfWork @ chunk-YZVM2MHU.js?v=d88510ea:19198
workLoopSync @ chunk-YZVM2MHU.js?v=d88510ea:19137
renderRootSync @ chunk-YZVM2MHU.js?v=d88510ea:19116
recoverFromConcurrentError @ chunk-YZVM2MHU.js?v=d88510ea:18736
performConcurrentWorkOnRoot @ chunk-YZVM2MHU.js?v=d88510ea:18684
workLoop @ chunk-YZVM2MHU.js?v=d88510ea:197
flushWork @ chunk-YZVM2MHU.js?v=d88510ea:176
performWorkUntilDeadline @ chunk-YZVM2MHU.js?v=d88510ea:384
Show 14 more frames
Show less
web-vitals.js?v=1536f103:167 {name: 'TTFB', value: 26, delta: 26, entries: Array(1), id: 'v2-1734128629949-3532956298581'}
ePickerSlice.js:69 data fetched
ePickerSlice.js:129 Question saved

@morozov-av
Copy link
Contributor Author

@bnmnetp Sorry, I didn’t remove the extra router and didn’t add the default path in the routing for the builder. I’ve made a fix; please try again.

It worked for me because I handled it manually locally and completely forgot about it. :( Another reason why large pull requests should be avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants