Wails: Caught Unhandled Error

Created on 21 Dec 2019  路  9Comments  路  Source: wailsapp/wails

after successful serve, and build -f.
run application, and got:

ERRO[0000] * Caught Unhandled Error *
ERRO[0000] Message: Script error.
ERRO[0000] URL:
ERRO[0000] Line No: 0
ERRO[0000] Column No: 0
ERRO[0000] error: null

What is mean? Where is bug? What I need to fix?

bug

Most helpful comment

Thank you, @bh90210 ! ;-)

All 9 comments

Without any context, we can't help much.

I'll try to give more information without posting all project...
And I try to explain.

  1. React project with react router etc....
  2. In "develop mode" - wails serve // ans yarn start in other terminal - all works fine
  3. Build (wails build -f, and (for test) - separate building js code with yarn prod... - no problem
  4. run project - got uncaught error.
    After some hours of comment/uncomment code - I think problem here
    /${page}} />
    When I remove this page - I don't got uncaught error. But. I'm not shure.

wails 1.0.1
js dependeces:
"core-js": "^3.1.4", "react": "^16.8.6", "react-dom": "^16.8.6", "wails-react-scripts": "3.0.1-2", "react-modal": "3.8.1", "@wailsapp/runtime": "^1.0.0", "@date-io/date-fns": "^1.3.11", "@material-ui/core": "^4.5.1", "@material-ui/icons": "^4.5.1", "@material-ui/pickers": "^3.2.7", "@y0c/react-datepicker": "^1.0.1", "classnames": "^2.2.6", "clsx": "^1.0.4", "connected-react-router": "^6.5.2", "date-fns": "^2.7.0", "dayjs": "^1.8.17", "history": "^4.10.1", "i18n": "^0.8.3", "i18next": "^18.0.1", "i18next-browser-languagedetector": "^4.0.0", "i18next-xhr-backend": "^3.2.0", "moment": "^2.24.0", "prop-types": "^15.7.2", "react-datepicker": "^2.10.0", "react-i18next": "^9.0.10", "react-input-mask": "^2.0.4", "react-onclickoutside": "^6.9.0", "react-redux": "^7.1.1", "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-redux-form": "^1.16.14", "redux": "^4.0.4", "redux-logger": "^3.0.6", "redux-saga": "^1.1.1", "reselect": "^4.0.0", "react-select": "^3.0.8"

Sorry for addon. But - as I see - problem somewhere in using ReactRouter...
and also - in serve mode - all works fine - no bugs. In build -f prod mode - doesn't work - ReactRouter doesn't render component. And Ufff

hey @VladislavSournine
when using react router only use the hash router (if not already) - ie. https://stackoverflow.com/questions/50266537/react-router-using-hash-url

also yarn use is not supported by wails, only npm, but I don't think your issue is yarn related.

hey @VladislavSournine
when using react router only use the hash router (if not already) - ie. https://stackoverflow.com/questions/50266537/react-router-using-hash-url

also yarn use is not supported by wails, only npm, but I don't think your issue is yarn related.

Yep. this solution works fine.

Thank you, @bh90210 ! ;-)

I think we.need to get some of this in the guides section of the site. I'll add this bit of information over the holidays

@leaanthony Good idea

Hello everyone,

I'm trying to use react-router using HashRouter as suggested and it works fine in dev (using serve).
But built binary is not working (on Windows, Wails 1.0.2).
As soon as the applications starts and renders it gets redirected to the page in the following screen (which I think is about:blank#/ ):

immagine

My router code is really the simplest possible:

<HashRouter>
    <Switch>
        <Route path='/' component={Home} />
    </Switch>
</HashRouter>

@VladislavSournine are you able to share your working solution?

Thanks!

Edit:
I run the same exact code on macOS, and I got the same error as op:

ERRO[0000] **** Caught Unhandled Error ****
ERRO[0000] Message: Script error.
ERRO[0000] URL:
ERRO[0000] Line No: 0
ERRO[0000] Column No: 0
ERRO[0000] error: null

Edit 2:
Switched to <MemoryRouter> everything works fine 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maxiride picture maxiride  路  6Comments

intelwalk picture intelwalk  路  4Comments

Lyimmi picture Lyimmi  路  4Comments

pedzed picture pedzed  路  7Comments

incafox picture incafox  路  7Comments