Picture of James Wan
Error when previewing or downloading a course
by James Wan - Saturday, 27 January 2024, 6:17 AM
 

Good day,

I need some technical insight into this error I get when I preview or try to download a course, thank you:

 

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

E:\adapt_authoring>node server
info: [27 Jan 2024 08:03:19 +02:00] configuration loaded from E:\adapt_authoring
\conf\config.json
info: [27 Jan 2024 08:03:19 +02:00] Supporting the following authentication type
s:
info: [27 Jan 2024 08:03:19 +02:00] - local
info: [27 Jan 2024 08:03:21 +02:00] You are currently running Adapt authoring to
ol v0.3.0 - v0.11.2 is now available
info: [27 Jan 2024 08:03:21 +02:00] The Adapt Framework being used is v2.2.2 - v
5.35.2 is now available
info: [27 Jan 2024 08:03:21 +02:00] Run "node upgrade.js" to update to the lates
t version
info: [27 Jan 2024 08:03:23 +02:00] Connection established: adapt-tenant-master
info: [27 Jan 2024 08:03:25 +02:00] Server started listening on port 5000
info: [27 Jan 2024 08:03:42 +02:00] Connection established: adapt-tenant-master
info: [27 Jan 2024 08:04:11 +02:00] Retrieving JSON
info: [27 Jan 2024 08:04:13 +02:00] All assets processed
info: [27 Jan 2024 08:04:13 +02:00] 3.1. Ensuring framework build exists
info: [27 Jan 2024 08:04:13 +02:00] 3.2. Using theme: adapt-contrib-vanilla
info: [27 Jan 2024 08:04:13 +02:00] 3.3. Using menu: adapt-contrib-boxMenu
info: [27 Jan 2024 08:04:13 +02:00] grunt server-build:prod --outputdir=courses\
5959398e2c54bd64ad7e1324\595a07684f6e7b7c297a70a9\build --theme=adapt-contrib-va
nilla --menu=adapt-contrib-boxMenu
error: [27 Jan 2024 08:04:14 +02:00] exec error: Error: Command failed: C:\Windo
ws\system32\cmd.exe /s /c "grunt server-build:prod --outputdir=courses\5959398e2
c54bd64ad7e1324\595a07684f6e7b7c297a70a9\build --theme=adapt-contrib-vanilla --m
enu=adapt-contrib-boxMenu"
C:\Users\User\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\micromatch
\index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true)
;
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\grunt-
cli\node_modules\findup-sync\index.js:12:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

error: [27 Jan 2024 08:04:14 +02:00] stdout error:
error: [27 Jan 2024 08:04:14 +02:00] Error: Command failed: C:\Windows\system32\
cmd.exe /s /c "grunt server-build:prod --outputdir=courses\5959398e2c54bd64ad7e1
324\595a07684f6e7b7c297a70a9\build --theme=adapt-contrib-vanilla --menu=adapt-co
ntrib-boxMenu"
C:\Users\User\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\micromatch
\index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true)
;
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\grunt-
cli\node_modules\findup-sync\index.js:12:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

error: [27 Jan 2024 08:04:14 +02:00] Error: Command failed: C:\Windows\system32\
cmd.exe /s /c "grunt server-build:prod --outputdir=courses\5959398e2c54bd64ad7e1
324\595a07684f6e7b7c297a70a9\build --theme=adapt-contrib-vanilla --menu=adapt-co
ntrib-boxMenu"
C:\Users\User\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\micromatch
\index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true)
;
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\grunt-
cli\node_modules\findup-sync\index.js:12:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

 

Picture of Oliver Foster
Re: Error when previewing or downloading a course
by Oliver Foster - Tuesday, 30 January 2024, 9:24 AM
 

It looks as though you may be on the wrong version of node. I think it's saying that `let` is an unexpected token, which means your version of node must be very very very old.

Picture of James Wan
Re: Error when previewing or downloading a course
by James Wan - Friday, 2 February 2024, 1:17 PM
 

Thank you, I appreciate the feedback. So I update my node version and I now get a different error.

 

C:\adapt_authoring>node server

C:\Windows\System32\cmd.exe - node  server[23164]: c:\ws\src\node_contextify.cc:676: Assertion `args[1]->IsString()' failed.

1: 00007FF6299D058F napi_wrap+109311

2: 00007FF6299752B6 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NumberOfElementsOffset+33302

3: 00007FF629975631 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NumberOfElementsOffset+34193

4: 00007FF629982787 node::OnFatalError+51239

5: 00007FF62A1EE72F v8::internal::Builtins::builtin_handle+321471

6: 00007FF62A1ED95C v8::internal::Builtins::builtin_handle+317932

7: 00007FF62A1EDFA2 v8::internal::Builtins::builtin_handle+319538

8: 00007FF62A1EDE03 v8::internal::Builtins::builtin_handle+319123

9: 00007FF62A2C9F9D v8::internal::SetupIsolateDelegate::SetupHeap+464173

10: 00007FF62A25E781 v8::internal::SetupIsolateDelegate::SetupHeap+23825

11: 00007FF62A348343 v8::internal::SetupIsolateDelegate::SetupHeap+981203

12: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

13: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

14: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

15: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

16: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

17: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

18: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

19: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

20: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

21: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

22: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

23: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

24: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

25: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

26: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

27: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

28: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

29: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

30: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

31: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

32: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

33: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

34: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

35: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

36: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

37: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

38: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

39: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

40: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

41: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

42: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

43: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

44: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

45: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

46: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

47: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

48: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

49: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

50: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

51: 00007FF62A25C4D9 v8::internal::SetupIsolateDelegate::SetupHeap+14953

52: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

53: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

54: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

55: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

56: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

57: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

58: 00007FF62A2628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498

59: 00007FF62A26055E v8::internal::SetupIsolateDelegate::SetupHeap+31470

60: 00007FF62A26014C v8::internal::SetupIsolateDelegate::SetupHeap+30428

61: 00007FF62A130631 v8::internal::Execution::CallWasm+1649

62: 00007FF62A12FE9F v8::internal::Execution::Call+191

63: 00007FF62A21B7E7 v8::Function::Call+615

64: 00007FF62999FCAE napi_unref_threadsafe_function+3278

65: 00007FF6299A3D67 node::Start+1159

66: 00007FF6299A4161 node::Start+2177

67: 00007FF6299F2501 node::LoadEnvironment+49

68: 00007FF629930203 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NumberOfBucketsOffset+9187

69: 00007FF6299A3A17 node::Start+311

70: 00007FF62980686C RC4_options+339820

71: 00007FF62A7A604C v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+153532

72: 00007FFAEC957344 BaseThreadInitThunk+20

73: 00007FFAEE9426B1 RtlUserThreadStart+33

Picture of Oliver Foster
Re: Error when previewing or downloading a course
by Oliver Foster - Friday, 2 February 2024, 2:11 PM
 

Could you please tell me which versions of node you were using?

Picture of James Wan
Re: Error when previewing or downloading a course
by James Wan - Wednesday, 7 February 2024, 7:41 AM
 

I was running: v4.4.7

and then upgraded to: v14.15.4

Picture of Oliver Foster
Re: Error when previewing or downloading a course
by Oliver Foster - Wednesday, 7 February 2024, 9:14 AM
 

Could you please upgrade to either 16 or 18 as specified in the package.json https://github.com/adaptlearning/adapt_authoring/blob/e0952e0462d72a8d87bc048f92a13197c02a3a89/package.json#L15-L17

And try again with a fresh install.