Project

General

Profile

Wt internal error; code: undefined, description: tr.size is not a function

Added by Emeric Poupon over 5 years ago

Hello,

I am quite confused. I am using precompiled packages of wt on a freshly installed Debian Stretch (wt 3.3.6)

I get this error when clicking on a button using Firefox: "Wt internal error; code: undefined, description: tr.size is not a function"

Using Chromium, the message is a bit different: "Wt internal error; code undefined, description: url.indexOf is not a function"

The code using the button is here: https://github.com/epoupon/fileshelter/blob/master/src/ui/ShareEdit.cpp#L91

I suspect a bug with the 3.3.6 package, since it seems to work fine with a manual install of wt.

What do you think? How can I debug that?

Emeric


Replies (29)

RE: Wt internal error; code: undefined, description: tr.size is not a function - Added by Emeric Poupon almost 5 years ago

Could you please provide an example to make the workaround work?

RE: Wt internal error; code: undefined, description: tr.size is not a function - Added by Roel Standaert almost 5 years ago

Right after you create the WApplication, you can use requireJQuery to load another version of JQuery:

Wt::WApplication *app = new Wt::WApplication(env);
app->requireJQuery("jquery.min.js");

That would work if jquery.min.js is in you docroot.

You can download the one Wt uses from here: https://raw.githubusercontent.com/emweb/wt/master/src/web/skeleton/jquery.min.js

Regards,

Roel

RE: Wt internal error; code: undefined, description: tr.size is not a function - Added by Emeric Poupon almost 5 years ago

Thanks for your support!

I tried what you said.

Unfortunately the page is loading but I can't do anything on it (no click work)

Here is what I have:

10.0.2.2 - - [2017-Dec-15 13:25:40.077945] "GET /home HTTP/1.1" 200 3988
10.0.2.2 - - [2017-Dec-15 13:25:40.088024] "POST /?wtd=2lia17zsS7AGKNzM HTTP/1.1" 200 130
10.0.2.2 - - [2017-Dec-15 13:25:40.101081] "GET /resources/themes/bootstrap/3/bootstrap.css HTTP/1.1" 200 122998
10.0.2.2 - - [2017-Dec-15 13:25:40.101140] "GET /resources/themes/bootstrap/3/wt.css HTTP/1.1" 200 19860
10.0.2.2 - - [2017-Dec-15 13:25:40.101158] "GET /resources/webkit-transitions.css HTTP/1.1" 200 6134
10.0.2.2 - - [2017-Dec-15 13:25:40.101891] "GET /css/fileshelter.css HTTP/1.1" 200 32
10.0.2.2 - - [2017-Dec-15 13:25:40.102194] "GET /resources/font-awesome/css/font-awesome.min.css HTTP/1.1" 200 31000
10.0.2.2 - - [2017-Dec-15 13:25:40.109613] "GET /jquery.min.js HTTP/1.1" 302 0
10.0.2.2 - - [2017-Dec-15 13:25:40.125576] "GET /home HTTP/1.1" 200 3994
10.0.2.2 - - [2017-Dec-15 13:25:40.211468] "GET /resources/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/1.1" 200 77160
10.0.2.2 - - [2017-Dec-15 13:25:40.291748] "GET /home?wtd=Btg09JCGzZ5rOBpf&sid=-1344932767&webGL=true&scrW=1920&scrH=1200&tz=60&htmlHistory=true&deployPath=%2F&request=script&rand=2188016153 HTTP/1.1" 200 24026
10.0.2.2 - - [2017-Dec-15 13:25:40.334093] "GET /favicon.ico HTTP/1.1" 404 85

Running with:

ARG = fileshelter
ARG = --config=/var/fileshelter/wt_config.xml
ARG = --docroot=/usr/share/fileshelter/docroot/;/resources,/css,/images,/favicon.ico
ARG = --approot=/usr/share/fileshelter/approot
ARG = --deploy-path=/
ARG = --http-port=5091
ARG = --http-address=0.0.0.0

ls -l /usr/share/fileshelter/docroot/
total 68
drwxr-xr-x 2 root root  4096 Dec 15 13:25 css
-rw-r--r-- 1 root root 62474 Dec 15 13:25 jquery.min.js
lrwxrwxrwx 1 root root    23 Nov 22 11:31 resources -> /usr/share/Wt/resources

RE: Wt internal error; code: undefined, description: tr.size is not a function - Added by Roel Standaert almost 5 years ago

You should add ,/jquery.min.js to your docroot, so it's:

--docroot=/usr/share/fileshelter/docroot/;/resources,/css,/images,/favicon.ico,/jquery.min.js
(26-29/29)