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

TypeError: can't redefine non-configurable property "$router" #10405

Closed
ChristophWurst opened this issue Nov 25, 2024 · 2 comments
Closed

TypeError: can't redefine non-configurable property "$router" #10405

ChristophWurst opened this issue Nov 25, 2024 · 2 comments

Comments

@ChristophWurst
Copy link
Member

Steps to reproduce

  1. Install Mail v4.1.0-beta1
  2. ???

Expected behavior

App loads

Actual behavior

08:06:27.883 TypeError: can't redefine non-configurable property "$router"
    NextJS 3
sentry.js:2:62546
    NextJS 23

Mail app version

v4.1.0-beta1

Nextcloud version

No response

Mailserver or service

No response

Operating system

No response

PHP engine version

None

Nextcloud memory caching

No response

Web server

None

Database

None

Additional info

No response

@ChristophWurst
Copy link
Member Author

Fixed by #10403

@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 💌 📅 👥 Groupware team Nov 25, 2024
@ChristophWurst
Copy link
Member Author

Post mortem analysis

Mail used asynchronously loaded components, as suggested at https://v2.vuejs.org/v2/guide/components-dynamic-async. This worked for years. For Mail v4.1.x we switched from Webpack to Vite for smaller frontend bundles. Things still worked for everyone but Greta's setup, and very few other people for a week or so.
Deployment to a production system broke the app for every user. The app content stayed blank because the main entrypoint of the app errored out.
Analysis showed that mail-main.mjs was loaded twice. Once with the cache buster ?v=xyz and once without. The Chromium network inspector revealed that once mail-main.mjs?v=xyz was included by the page and mail-main.mjs was included by home-abc.mjs. Home.vue is an async'ly loaded component. Inspecting the code showed that it has an import of the main bundle. This is a cyclic dependency: mail-main.js?v=xyz -> home-abc.mjs -> mail-main.mjs. The main bundle registers the $router property on the Vue instance, which fails the second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ☑️ Done
Development

No branches or pull requests

1 participant