@Teodor I was able to replicate the issue:
Index page:
<html>
<head>
<script src="dmxAppConnect/dmxAppConnect.js"></script>
<meta charset="UTF-8">
<title>Untitled Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="js/routes.js" defer></script>
<link rel="stylesheet" href="bootstrap/5/css/bootstrap.min.css" />
<script src="dmxAppConnect/dmxRouting/dmxRouting.js" defer></script>
<script src="dmxAppConnect/dmxBootstrap5Navigation/dmxBootstrap5Navigation.js" defer></script>
</head>
<body is="dmx-app" id="index">
<header class="">
<div class="container">
<div class="row">
<div class="col">
<nav class="navbar navbar-expand-lg justify-content-end">
<a class="navbar-brand me-auto" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar1_collapse" aria-controls="navbar1_collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbar1_collapse">
<div class="navbar-nav">
<a class="nav-item nav-link" href="/" internal="true">Home</a>
<a class="nav-item nav-link" href="/profile" internal="true">Profile</a>
</div>
</div>
</nav>
</div>
</div>
</div>
</header>
<div is="dmx-view" id="view1"></div>
<script src="bootstrap/5/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Home page:
<!-- Wappler include head-page="index.html" is="dmx-app" id="home" appConnect="local" bootstrap5="local" capacitor="local" -->
<h1>Home</h1>
Profile page
<!-- Wappler include head-page="index.html" is="dmx-app" id="profile" appConnect="local" bootstrap5="local" capacitor="local" -->
<h1>Profile<br></h1>
Routes.js file
[
{
"path": "/",
"url": "./home.html"
},
{
"path": "/profile",
"url": "./profile.html"
}
]
According to the docs, I should see the home paragraph when I start the app, and navigate without issues, but that is not happening.
Also found this on console:
2024-04-11 11:04:20.437 13549-13622 Capacitor com.example.app D Handling local request: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js
2024-04-11 11:04:20.438 13549-13622 com.example.app com.example.app E Failed to open file '/data/data/com.example.app/code_cache/.overlay/base.apk/assets/public/dmxAppConnect/dmxRouting/dmxRouting.js': No such file or directory
2024-04-11 11:04:20.439 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: TypeError: Cannot set properties of null (setting 'innerHTML')
2024-04-11 11:04:20.500 13549-13549 Capacitor/Console com.example.app E File: - Line 821 - Msg: TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.503 13549-13549 Capacitor com.example.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught TypeError: Cannot read properties of undefined (reading 'router')","url":"http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js","line":7,"col":6130,"errorObject":"{}"}}
2024-04-11 11:04:20.504 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: Uncaught TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.504 13549-13549 Capacitor/Console com.example.app E File: - Line 821 - Msg: TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.505 13549-13549 Capacitor com.example.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught TypeError: Cannot read properties of undefined (reading 'router')","url":"http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js","line":7,"col":6130,"errorObject":"{}"}}
2024-04-11 11:04:20.505 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: Uncaught TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.506 13549-13549 Capacitor/Console com.example.app E File: - Line 821 - Msg: TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.506 13549-13549 Capacitor com.example.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught TypeError: Cannot read properties of undefined (reading 'router')","url":"http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js","line":7,"col":6130,"errorObject":"{}"}}
2024-04-11 11:04:20.506 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: Uncaught TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.507 13549-13549 Capacitor/Console com.example.app E File: - Line 821 - Msg: TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.507 13549-13549 Capacitor com.example.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught TypeError: Cannot read properties of undefined (reading 'router')","url":"http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js","line":7,"col":6130,"errorObject":"{}"}}
2024-04-11 11:04:20.508 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: Uncaught TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.508 13549-13549 Capacitor/Console com.example.app E File: - Line 821 - Msg: TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.509 13549-13549 Capacitor com.example.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught TypeError: Cannot read properties of undefined (reading 'router')","url":"http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js","line":7,"col":6130,"errorObject":"{}"}}
2024-04-11 11:04:20.509 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: Uncaught TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.509 13549-13549 Capacitor/Console com.example.app E File: - Line 821 - Msg: TypeError: Cannot read properties of undefined (reading 'router')
2024-04-11 11:04:20.510 13549-13549 Capacitor com.example.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught TypeError: Cannot read properties of undefined (reading 'router')","url":"http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js","line":7,"col":6130,"errorObject":"{}"}}
2024-04-11 11:04:20.510 13549-13549 Capacitor/Console com.example.app E File: http://localhost/dmxAppConnect/dmxRouting/dmxRouting.js - Line 7 - Msg: Uncaught TypeError: Cannot read properties of undefined (reading 'router')