Problem debugging

Hi, I have created a form with conditional fields and the following error messages appear. I have amended some of the erros but they keep appearing. And I am not sure how can I debug r8qtd.js

public/pages/r8qtd.js/r8qtd.js: Missing semicolon (1:23)

1 | import (dataSubmission) ‘from backend/submission’;
|
^ 2 | import wixLocation from ‘wix-location’;
3 |
4 | $w.onReady(function () {

Loading the code for the PRUEBA MODOS DE PAGO page. To debug this code, open r8qtd.js in Developer Tools.

Please help,

Thanks!

Post site URL (the page having code)

You’re probably importing them in a wrong way, try this instead:

import { dataSubmission } from 'backend/submission.jsw';

You need to put the imported functions in a curly braces, and include the file extension as well, I assume it’s a web module since you can’t import backend JavaScript files.

The page’s on ready function should be like this:

$w.onReady(() => {

})

Hope this helps~!
Ahmad

Hi Ahmad,

Thanks! The import change worked, however, the onready is still not. The following errors appear:

Argument of type ‘boolean’ is not assignable to parameter of type ‘ReadyHandler’. This condition will always return ‘false’ since the types ‘() => any’ and ‘boolean’ have no overlap.

    public/pages/r8qtd.js/r8qtd.js: Unexpected token (4:12)     
2 | import wixLocation from 'wix-location';   
3 |  

4 | $w.onReady(() ==> {
| ^
5 |
6 | })
7 |

  • Loading the code for the PRUEBA MODOS DE PAGO page. To debug this code, open r8qtd.js in Developer Tools