Page 1 of 1

Extadm: (index):24 SyntaxError: Unexpected token default

Posted: 25 Jul 2016, 06:46
by jossnaz
I tried moving my server to php 7 and everything went fine. Now I changed a couple things in nginx config and prepared some files... i still have no clue where this error is coming from, the frontend seems to work fine, i have this only in the backend.

when accessing (ffix.local points to my localhost) http://ffix.local/extadm/ in my browser

note:

Code: Select all

                update: {
                    type: 'Laravel',
                    version: '2016.07.2'
                }

Code: Select all

(index):24 Uncaught SyntaxError: Unexpected token default

file?site=default:363 Uncaught TypeError: Cannot read property 'data' of undefined




Code: Select all

<!DOCTYPE html>
<html>
    <head>
        <title>Aimeos administration Interface</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />

        <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/ext-all.css" />
        <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/xtheme-gray.css" />
        <link rel="stylesheet" href="http://ffix.local/packages/aimeos/shop/admin/extjs/resources/css/main.css?v=1469427914" />
        <link rel="stylesheet" href="http://ffix.local/packages/aimeos/shop/admin/extjs/lib/ext.ux/AdvancedSearch/resources/css/advandedsearch.css?v=1469427914" />
        <link rel="stylesheet" href="http://ffix.local/packages/aimeos/shop/admin/extjs/lib/ext.ux/Portal/resources/css/Portal.css?v=1469427914" />

        <script type="text/javascript">
        window.MShop = {

            i18n: {
                lang: 'en',
                content: {"admin":{"Costs per item":"Costs per item","Product supplier (optional)":"Product supplier (optional)","Product tag: {0} ({1})":"Product tag: {0} ({1})","pay:authorized":"authorized","pay:canceled":"canceled","pay:deleted":"deleted","pay:pending":"pending","pay:received":"received","pay:refund":"refund","pay:refused":"refused","pay:unfinished":"unfinished","stat:deleted":"deleted","stat:delivered":"delivered","stat:dispatched":"dispatched","stat:lost":"lost","stat:pending":"pending","stat:progress":"progress","stat:refused":"refused","stat:returned":"returned","stat:unfinished":"unfinished","status:archive":"archive","status:disabled":"disabled","status:enabled":"enabled","status:review":"review"},"admin\/ext":{"!=":"not equals","<":"before","<=":"before (incl.)","==":"equals","=~":"starts with",">":"after",">=":"after (incl.)","~=":"contains"}},
                available: [{"id":"bg","label":"bg"},{"id":"cs","label":"cs"},{"id":"de","label":"de"},{"id":"en","label":"en"},{"id":"es","label":"es"},{"id":"fa","label":"fa"},{"id":"fr","label":"fr"},{"id":"it","label":"it"},{"id":"nl","label":"nl"},{"id":"no","label":"no"},{"id":"pl","label":"pl"},{"id":"ru","label":"ru"},{"id":"sk","label":"sk"},{"id":"sr","label":"sr"},{"id":"tr","label":"tr"},{"id":"uk","label":"uk"},{"id":"vi","label":"vi"},{"id":"zh","label":"zh"},{"id":"zh_CN","label":"zh_CN"}]            },

            config: {
                site: default,
                data: {"admin":{"extjs":{"url":{"target":"aimeos_shop_extadm"}}}},
                smd: {"transport":"POST","envelope":"JSON-RPC-2.0","contentType":"application\/json","SMDVersion":"2.0","target":"http:\/\/ffix.local\/extadm\/do?site=default&_token=Pg93SbVymruKyAtn6gBiag2TTkjcmZCL85Jkm8lP","services":{"Admin_Job.init":{"parameters":[{"type":"string","name":"site","optional":false},
.....


 editor","optional":false,"type":"string"}}}},
                urlTemplate: 'http://ffix.local/extadm?site={site}&lang={lang}&tab={tab}',
                jqadmurl: 'http://ffix.local/jqadm/search/product?site=default',
                activeTab: 0,

                baseurl: {
                    content: 'http://ffix.local/'
                },

                update: {
                    type: 'Laravel',
                    version: '2016.07.2'
                }
            }
        }
        </script>

        <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/ext-all.js"></script>
        <script type="text/javascript" src="http://ffix.local/extadm/file?site=default"></script>

    </head>
    <body>
        <noscript><p>You need to enable javascript!</p></noscript>
    </body>
</html>
I ran

Code: Select all

 php artisan cache:clear
and

Code: Select all

 php artisan aimeos:cache
and

Code: Select all

php artisan aimeos:setup

**EDIT**

this happens on php 5.6 and php 7


when accessing /admin or http://ffix.local/jqadm/search/dashboar ... lt&lang=en i get:

Code: Select all

js?site=default:1228 Uncaught ReferenceError: d3 is not definedAimeos.Dashboard.Order.chartDay @ js?site=default:1228Aimeos.Dashboard.Order.init @ js?site=default:1213(anonymous function) @ js?site=default:1684j @ jquery.js:3099k.fireWith @ jquery.js:3211n.extend.ready @ jquery.js:3417I @ jquery.js:3433
js?site=default:1450 Uncaught ReferenceError: d3 is not defined(anonymous function) @ js?site=default:1450(anonymous function) @ jquery.js:3256j @ jquery.js:3099k.fireWith @ jquery.js:3211e.(anonymous function) @ jquery.js:3301j @ jquery.js:3099k.fireWith @ jquery.js:3211x @ jquery.js:8264(anonymous function) @ jquery.js:8605
js?site=default:1372 Uncaught ReferenceError: d3 is not defined(anonymous function) @ js?site=default:1372(anonymous function) @ jquery.js:3256j @ jquery.js:3099k.fireWith @ jquery.js:3211e.(anonymous function) @ jquery.js:3301j @ jquery.js:3099k.fireWith @ jquery.js:3211x @ jquery.js:8264(anonymous function) @ jquery.js:8605
2js?site=default:1610 Uncaught ReferenceError: d3 is not defined

Re: Extadm: (index):24 SyntaxError: Unexpected token default

Posted: 25 Jul 2016, 21:29
by jossnaz
the solution is as easy as it is disappointing. That is, downgrade to 2016.04.3

Can i ask you guys to a favor? first, try to reproduce what problem i had (i can reproduce it any time)

basically I installed 2016.04, later upgraded to 2016.07, i always get said errors.
To fix it, i had to downgrade as mentioned

on your installation guide here:

https://github.com/aimeos/aimeos-laravel

remove the line:

Code: Select all

"aimeos/aimeos-laravel": "~2016.04",
replace it with

Code: Select all

"aimeos/aimeos-laravel": "~2016.04.3",
well you guys probably already know, but ~2016.04 will jump any patch and any minor release, that is, for me it jumped release 2016.07.2 and that just does not have a working backend.

See here https://getcomposer.org/doc/articles/versions.md#tilde

note: i think i actually manually put 2016.07.2 there, because i wanted the newest, but anyone running ~2016.04 will get 07 without working backend I think.

this post belongs into the laravel forum i guess.

Re: Extadm: (index):24 SyntaxError: Unexpected token default

Posted: 26 Jul 2016, 20:36
by aimeos
Did you've followed the upgrade guide: https://aimeos.org/docs/Laravel/Upgrade

In Laravel, all Blade views are copied to ./resources/views/vendor/shop/ (design decision by Taylor Otwell). You've probably hit a problem with old views which are not compatible to the new version any more.

Re: Extadm: (index):24 SyntaxError: Unexpected token default

Posted: 27 Jul 2016, 01:42
by jossnaz
oh... was it actually meant with:

Upgrade to 2016.x that is


"Upgrade 2016.x to 2016.y" where x < y?

i thought that this part was only for the guys running 2015.x

i will have a look at it

Re: Extadm: (index):24 SyntaxError: Unexpected token default

Posted: 27 Jul 2016, 23:09
by aimeos
Upgrade from 2015/2016 to 2016.x or even better: Always :-)

Re: Extadm: (index):24 SyntaxError: Unexpected token default

Posted: 27 Jul 2016, 23:17
by jossnaz
first of all, it seems to work now.


the thing is, I was already on "2016.x" so I thought if I am already on 2016, i don't have to run that part of the migration. But i get it now.