e-Learning-by-SSE / nm-self-learning

https://staging.sse.uni-hildesheim.de/selflearn
4 stars 4 forks source link

chore: upgrade all dependency, includes major upgrades #183

Closed spark-sse closed 3 months ago

Elscha commented 3 months ago

Seite lief extrem langsam bzw hat teilweise nicht geladen. In der Console hatte ich immer wieder folgenden Fehler:

Firefox kann keine Verbindung zu dem Server unter ws://localhost:4200/_next/webpack-hmr aufbauen. main.js line 710 > eval:77:18

Gemäß https://stackoverflow.com/a/73879833 habe ich in apps/site/next.config.js den folgenden Konfigurationswert optional gemacht: assetPrefix: process.env.NEXT_ASSET_PREFIX ?? "/",assetPrefix: process.env.NEXT_ASSET_PREFIX, danach schien es wieder besser zu laufen. @spark-sse wird unbedingt ein default Wert für den Eintrag benötigt? Auch unter https://nextjs.org/docs/app/api-reference/next-config-js/assetPrefix wird der nur zur optionalen Konfiguration eines FQDNs genutzt.

Elscha commented 3 months ago
Feature Funktionalität Bemerkung
Minio Fehlermeldung bei Serverausfall / falscher Konfiguration irreführend. presignedPut meldet: Upload Error: TRPCClientError: Minio Access Error: Unable to get bucket region for upload. Hier sollten wir ggf. Fehlermeldung überschreiben.
spark-sse commented 3 months ago

Seite lief extrem langsam bzw hat teilweise nicht geladen. In der Console hatte ich immer wieder folgenden Fehler:

Firefox kann keine Verbindung zu dem Server unter ws://localhost:4200/_next/webpack-hmr aufbauen. main.js line 710 > eval:77:18

Gemäß https://stackoverflow.com/a/73879833 habe ich in apps/site/next.config.js den folgenden Konfigurationswert optional gemacht: assetPrefix: process.env.NEXT_ASSET_PREFIX ?? "/",assetPrefix: process.env.NEXT_ASSET_PREFIX, danach schien es wieder besser zu laufen. @spark-sse wird unbedingt ein default Wert für den Eintrag benötigt? Auch unter https://nextjs.org/docs/app/api-reference/next-config-js/assetPrefix wird der nur zur optionalen Konfiguration eines FQDNs genutzt.

ASSET_PREFIX an sich wird benötigt. Es legt fest, von wo die Ressourcen unter _next/static abgerufen werden. Wenn wir die Website beispielsweise unter example.com/selflearn betreiben, war ASSET_PREFIX=/selflearn in der Konfiguration gesetzt.

Ich vermute dass der Default-Wert nicht benötigt wird. Kannst du einmal testen ob Minio in der neuen Version auch Probleme hat, wenn folgendes gesetzt ist ASSET_PREFIX=/selflearn?

Wenn ja, sollten wir mal testen, ob wir ein FQDN setzen. Also zum Beispiel: ASSET_PREFIX=${public_domain}/${base_path}, wobei public_domain=https://example.com und base_path=/selflearn wäre.

EDIT: neuer kommentar, da frage falsch verstanden

spark-sse commented 3 months ago

Message from test run: [1]

  | > nx run site:build:production
nm-self-learning-1  |
nm-self-learning-1  | (node:31) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
nm-self-learning-1  | (Use `node --trace-deprecation ...` to show where the warning was created)
nm-self-learning-1  |   ▲ Next.js 14.2.5
nm-self-learning-1  |    Skipping linting
nm-self-learning-1  |    Checking validity of types ...
nm-self-learning-1  |    Creating an optimized production build ...
nm-self-learning-1  | Failed to compile.
nm-self-learning-1  |
nm-self-learning-1  | ../pages/teaching/subjects/[subjectId]/[specializationId].js from Terser
nm-self-learning-1  | invalid unicode code point at line 1 column 72249
nm-self-learning-1  | Error: invalid unicode code point at line 1 column 72249
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:814:33)
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:891:21)
nm-self-learning-1  |     at async Object.minify (/app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:149:44)
nm-self-learning-1  |     at async /app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:205:42
nm-self-learning-1  |     at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:154:20)
nm-self-learning-1  | ../pages/courses/[courseSlug]/[lessonSlug].js from Terser
nm-self-learning-1  | invalid unicode code point at line 1 column 49902
nm-self-learning-1  | Error: invalid unicode code point at line 1 column 49902
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:814:33)
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:891:21)
nm-self-learning-1  |     at async Object.minify (/app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:149:44)
nm-self-learning-1  |     at async /app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:205:42
nm-self-learning-1  |     at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:154:20)
nm-self-learning-1  | 7641.js from Terser
nm-self-learning-1  | invalid unicode code point at line 1 column 68508
nm-self-learning-1  | Error: invalid unicode code point at line 1 column 68508
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:814:33)
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:891:21)
nm-self-learning-1  |     at async Object.minify (/app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:149:44)
nm-self-learning-1  |     at async /app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:205:42
nm-self-learning-1  |     at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:154:20)
nm-self-learning-1  | 1896.js from Terser
nm-self-learning-1  | invalid unicode code point at line 1 column 277292
nm-self-learning-1  | Error: invalid unicode code point at line 1 column 277292
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:814:33)
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:891:21)
nm-self-learning-1  |     at async Object.minify (/app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:149:44)
nm-self-learning-1  |     at async /app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:205:42
nm-self-learning-1  |     at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:154:20)
nm-self-learning-1  | 585.js from Terser
nm-self-learning-1  | invalid unicode code point at line 1 column 45777
nm-self-learning-1  | Error: invalid unicode code point at line 1 column 45777
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:814:33)
nm-self-learning-1  |     at Object.minify (/app/node_modules/next/dist/build/swc/index.js:891:21)
nm-self-learning-1  |     at async Object.minify (/app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:149:44)
nm-self-learning-1  |     at async /app/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:205:42
nm-self-learning-1  |     at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:154:20)
nm-self-learning-1  | > Build failed because of webpack errors
nm-self-learning-1  | Build process exited due to code 1

[2]

 ⚠ You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env
spark-sse commented 3 months ago

problem [1]: https://github.com/vercel/next.js/discussions/69326 problem [2]: entfernen von NODE_ENV in der Dockerfile

spark-sse commented 3 months ago

instanz getestet mit folgenden einstellungen:

            - DATABASE_URL=...
            - NEXTAUTH_SECRET=...
            - NEXTAUTH_URL=http://url/selflearn
            - NEXT_PUBLIC_IS_DEMO_INSTANCE=true
            - NEXT_PUBLIC_BASE_PATH=/selflearn

Läuft unter: http://147.172.178.45:3100/selflearn/subjects

Sieht auf den ersten Blick so aus, als könnte ASSET_PREFIX überflüssig sein.

Allerdings gibt es aktuell ein Runtime Fragment error. [3]

Error: Passing props on "Fragment"!

The current component <Transition.Child /> is rendering a "Fragment".
However we need to passthrough the following props:
  - ref

You can apply a few solutions:
  - Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".
  - Render a single element as the child so that we can forward the props onto that element.
    NextJS 13
spark-sse commented 3 months ago

[3] gelöst.