Getting this error in solidjs. It is working fine when opening in web, but after deploying it and opening the url in webview (from ReactNative code), i am getting this error in web console, due to which it is not rendering. Not sure this error is exactly related to routes or anything else.
Also this error comes only on opening the web url in webview, in web it works fine
TypeError: c.outlet is not a function
at get children [as children] (index.21a14473.js:1:27599)
at Object.fn (index.21a14473.js:1:7536)
at Kn (index.21a14473.js:1:5104)
at de (index.21a14473.js:1:5047)
at T (index.21a14473.js:1:1728)
at Xt (index.21a14473.js:1:4096)
at index.21a14473.js:1:7527
at k (index.21a14473.js:1:3312)
at Object.fn (index.21a14473.js:1:7496)
at Kn (index.21a14473.js:1:5104)
I am using "solid-app-router": "^0.3.2", "solid-js": "^1.3.15"
. I am registering routes as
Routes.jsx
import { Router, useRoutes } from 'solid-app-router';
const routes = [
{
path: '/',
component: lazy(() => import('./Home')),
},
{
path: '/about',
component: lazy(() => import('./about')),
}
]
const App = () =>{
const Routes = useRoutes(routes)
return (
<Router>
<Routes/>
</Router>
)
}
Index.js
import { render } from 'solid-js/web'
import Routes from './Routes';
render(() => <Routes />, document.getElementById('root'));
UPD -> Upon further investigation, i found this issue is not with router but with solidjs library itself
2
Answers
Have downgraded the version to
1.4.8
and it was working fine now in webview. This error is not related to routes, rather it was of solidjs as i tried different versions, i was getting different errors in webview 1.6.14 ->ws.not a function
, 1.5 ->No is not a function
.In 1.4.8 it was working fine in webview also
Also the issue was, i am using solid-app-router which is deprecated now and that version had this isseu which was fixed in later version when it was moved to @solidjs/router
Update @solidjs/router to the lates, it works fine.
My current setup:
"solid-js": "^1.7.3",
"@solidjs/router": "^0.8.2",