Dan7412167
Posts: 0
Joined: Tue Mar 03, 2015 4:27 pm

Unexpected Reserved Word - Server Script

When I try to write a server side script that includes the "import" command, such as:

import org.scribe.model.OAuthRequest;

I get the following error: "Unexpected reserved word ( @ 1 : 0 ) - import"

Is there some other way I should be writing this on this platform?

Thanks.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Unexpected Reserved Word - Server Script

Hi Dan,

import directive not supported with v8 JS engine.

You can create your JS library and use it in the server script.

See details here: http://devcenter.appery.io/documentat...

Regards.

Dan7412167
Posts: 0
Joined: Tue Mar 03, 2015 4:27 pm

Unexpected Reserved Word - Server Script

The problem still when used in a library. I placed the import code into a library, run a script that uses it as a dependency, and it fails with the exact same error.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Unexpected Reserved Word - Server Script

Hi Dan,

You don't need to use "import" directive...

So if your 3rd party code uses this directive you should alter this code.

Regards.

Dan7412167
Posts: 0
Joined: Tue Mar 03, 2015 4:27 pm

Unexpected Reserved Word - Server Script

Maybe I should qualify, I'm new to java programming, and app development in general. When you say alter the code, are you simply saying exclude it, or do I need to code it in a different way?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Unexpected Reserved Word - Server Script

Hi Dan,

Unfortunatly you can not use this JS code in Appery.io server code without changes to fit it to V8 JS engine.

Regards.

Dan7412167
Posts: 0
Joined: Tue Mar 03, 2015 4:27 pm

Unexpected Reserved Word - Server Script

Ok, maybe I'm not understanding my options here. Will this simply not work? I'm trying to use some Yelp API code and if you're telling me I cant, I'll move on to another product.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Unexpected Reserved Word - Server Script

Hi Dan,

Yes, you can not use this implementation in Appery.io server code.

May be it's better to use some REST API of this service?

Please read more about it here: https://www.yelp.com/developers/docum...

Regards.

Return to “Issues”