Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

JavaScript USE api error - jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "use" is not defined

Avatar

Avatar
Boost 1
Level 1
nazarenom938062
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
nazarenom938062
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
nazarenom938062
Level 1

28-01-2020

Hello,

 

Having an issue with an older component that is not loading the global 'use' keyword.

<div class="band-xxx">
<sly data-sly-resource="${'par' @ resourceType='xxx/components/sightly/xxxx/xxxx/components/parsys'}"/>
</div>

where parsys.js under component/parsys is defined as ..

use(["/libs/wcm/foundation/components/parsys/parsys.js", "customScriphere.js"], function (parsysComponent, filter) { ...

 

Looks like the global 'use' function is not available for whatever reason. i am seeing the following error message in the logs. i have other similar components following the same pattern but this one is the only one with this issue. any help would be appreciated.

 

Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "use" is not defined

at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)

at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)

at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)

at jdk.scripting.nashorn/jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1616)

at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1$\^eval\_/0x0000000801b13440.:program(<eval>:3)

at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)

at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)

at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)

at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:428)

at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:521)

 

Thanks

 

View Entire Topic

Avatar

Avatar
Validate 1
Level 3
sdouglasmc
Level 3

Likes

18 likes

Total Posts

83 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 3
sdouglasmc
Level 3

Likes

18 likes

Total Posts

83 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 5
Boost 3
View profile
sdouglasmc
Level 3

22-04-2020

Running AEM 6.5.4
Java(TM) SE Runtime Environment(build 11.0.5+10-LTS)


Have you solved this issue?  We have no problem when we restart AEM, all things seem to work fine.  What appears to be out of the blue, all HTL related pages stop displaying with this same error.  If we restart, we are fine again.  

22.04.2020 19:47:06.739 ERROR [10.65.37.142 [1587577626473] GET /ca/en_ca.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "use" is not defined
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
at jdk.scripting.nashorn/jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1616)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$63$\^eval\_/0x0000000802409c40.:program(<eval>:1)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:428)
at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:521)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386) [org.apache.sling.scripting.core:2.0.56]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.0.56]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.0.56]
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552) [org.apache.sling.engine:2.6.20]
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44) [org.apache.sling.engine:2.6.20]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82) [org.apache.sling.engine:2.6.20]
at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:119) [com.day.cq.wcm.cq-wcm-core:5.12.118]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138) [com.day.cq.wcm.cq-wcm-core:5.12.118]