You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using lit-element in combination with page.js and I'm running into an error. The code below is a simplification of the code I'm working on:
import{LitElement,html,css,property,customElement}from'lit-element'
@customElement('my-app')exportclassmyAppextendsLitElement{// Element propertiesstaticgetproperties(){return{page:{type:String}}}// Constructorconstructor(){super()page('/',()=>this.page='index')page('/test/:id',()=>{console.log('TRACE');this.page='test'})page()}render(){if(this.page==="index"){returnhtml`index`}if(this.page==="test"){returnhtml`test`}}}
The route '/' works fine and shows me index, however the route /test/abc gives me the following error:
client.js:1 Uncaught SyntaxError: Unexpected token '<'
Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('http://localhost:3000/test/') with script ('http://localhost:3000/test/sw.js'): The script has an unsupported MIME type ('text/html').
Also the TRACE is not logged in console.
Not sure if the error is relatable as my setup is far more complex then the example above. But maybe someone has experience using page.js and lit-element together and has run up to similar problems before?
The text was updated successfully, but these errors were encountered:
I'm using lit-element in combination with page.js and I'm running into an error. The code below is a simplification of the code I'm working on:
The route
'/'
works fine and shows me index, however the route/test/abc
gives me the following error:Also the
TRACE
is not logged in console.Not sure if the error is relatable as my setup is far more complex then the example above. But maybe someone has experience using page.js and lit-element together and has run up to similar problems before?
The text was updated successfully, but these errors were encountered: