getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

Migration plugin throws an "The JSON response could not be parsed" error #3953

Closed GiantCrocodile closed 2 years ago

GiantCrocodile commented 2 years ago

Describe the bug
After pasting the plugin to the plugin folder and opening the Kirby 3 panel, you get the error mentioned in the title of this issue.

Expected behavior
No error

Screenshots
grafik

Kirby Version
v3.6.0

Console output

The JSON response could not be parsed index.js:1:12368
    fatal index.js:1
    s vendor.js:6
    dispatch common.js:5
    dispatch vendor.js:6
    request index.js:1
    go index.js:1
    $go index.js:1
    onClick index.js:1
    Vt vendor.js:6
    n vendor.js:6
    _wrapper vendor.js:6
    (Async: EventListener.handleEvent)
    to vendor.js:6
    ae vendor.js:6
    no vendor.js:6
    g vendor.js:6
    f vendor.js:6
    Ho vendor.js:6
    _update vendor.js:6
    r vendor.js:6
    get vendor.js:6
    vn vendor.js:6
    mount vendor.js:6
    $mount vendor.js:6
    $mount vendor.js:6
    init vendor.js:6
    f vendor.js:6
    f vendor.js:6
    Ho vendor.js:6
    _update vendor.js:6
    r vendor.js:6
    get vendor.js:6
    vn vendor.js:6
    mount vendor.js:6
    $mount vendor.js:6
    $mount vendor.js:6
    init vendor.js:6
    f vendor.js:6
    f vendor.js:6
    Ho vendor.js:6
    _update vendor.js:6
    r vendor.js:6

Desktop (please complete the following information):
Windows 10, WAMP, latest Firefox

Additional context
multilang site with 1 lang, I was logged in and had the panel open before I did copy and paste the plugin

lukasbestle commented 2 years ago

The error occurs because the migration plugin outputs HTML, not JSON. This is as expected but does not cause any harm. As stated in the release notes and in the comment inside the plugin file, please use the plugin in the site frontend, not in the Panel. Of course you can and should delete the plugin again after the migration.

GiantCrocodile commented 2 years ago

@lukasbestle I see. First time I understood it like you said but I was surprised that it did work in the panel (I had to use the panel to navigate to some page as I had no browser history active in my development setup) and then I was not sure if frontend was meant as in any page of Kirby 3 I call in the browser or just the real frontpages for the page visitors.