Picture of Bradley Barfoot
Cannot create property 'path' on string 'required'
by Bradley Barfoot - Monday, 25 February 2019, 4:54 PM
 

Hi,

I've had to perform the creation of the Node server a few times just to get my head around it; but after having successfully run node server I'm able to login & access the tools. However, whenever I try to upload an asset the asset loads and accepts the description etc. but the server throws the following error:

TypeError: Cannot create property 'path' on string 'required'
at C:\Users\b.barfoot\Desktop\ADAPT2\Pre-requisites\adapt_authoring\node_modules\mongoose\lib\schematype.js:948:30
at Array.forEach (<anonymous>)
at SchemaString.SchemaType.doValidate (C:\Users\b.barfoot\Desktop\ADAPT2\Pre-requisites\adapt_authoring\node_modules\mongoose\lib\schematype.js:939:19)
at C:\Users\b.barfoot\Desktop\ADAPT2\Pre-requisites\adapt_authoring\node_modules\mongoose\lib\document.js:1936:9
at process._tickCallback (internal/process/next_tick.js:61:11)

 

I made sure to create an environmental variable called 'path', as per the tutorial, but I can't seem to pass this error. The same error is also thrown when I try to save a course, or make an update.

 

Any help would be great,

Thanks.


Picture of Luke Thornton
Re: Cannot create property 'path' on string 'required'
by Luke Thornton - Monday, 25 February 2019, 6:49 PM
 

I am having the same issue when creating a course on Ubuntu 18.04. Node 10.15.1, npm 6.4.1, MongoDB 4.0.6, git is 2.17.1. Authoring tool version is 0.6.4, and I get the error no matter which framework I have installed at the moment up to v4.0.1. 

I can however upload to the asset manager if using it from main and not in a course. 

TypeError: Cannot create property 'path' on string 'required'
    at /home/lukifur/adapt_authoring/node_modules/mongoose/lib/schematype.js:948:30
    at Array.forEach (<anonymous>)
    at SchemaString.SchemaType.doValidate (/home/lukifur/adapt_authoring/node_modules/mongoose/lib/schematype.js:939:19)
    at /home/lukifur/adapt_authoring/node_modules/mongoose/lib/document.js:1936:9
    at process._tickCallback (internal/process/next_tick.js:61:11)
Picture of Didier Blanqui
Re: Cannot create property 'path' on string 'required'
by Didier Blanqui - Monday, 25 February 2019, 7:17 PM
 

Hi,

I have the same issue whith saving in adapt authoring tool on Mac OS Mojave but on Ubuntu 18.04 either: Something went wrong while saving your data.Please try again. When I try to Select an asset as Preview image I have an error too : An error occurred doing the save

Here is the message on the terminal for these two cases:
TypeError: Cannot create property 'path' on string 'required'
at /Users/didier/Adapt_authoring/adapt_authoring/node_modules/mongoose/lib/schematype.js:948:30
at Array.forEach (<anonymous>)
at SchemaString.SchemaType.doValidate (/Users/didier/Adapt_authoring/adapt_authoring/node_modules/mongoose/lib/schematype.js:939:19)
at /Users/didier/Adapt_authoring/adapt_authoring/node_modules/mongoose/lib/document.js:1936:9
at process._tickCallback (internal/process/next_tick.js:61:11)
TypeError: Cannot create property 'path' on string 'required'
at /Users/didier/Adapt_authoring/adapt_authoring/node_modules/mongoose/lib/schematype.js:948:30
at Array.forEach (<anonymous>)
at SchemaString.SchemaType.doValidate (/Users/didier/Adapt_authoring/adapt_authoring/node_modules/mongoose/lib/schematype.js:939:19)
at /Users/didier/Adapt_authoring/adapt_authoring/node_modules/mongoose/lib/document.js:1936:9
at process._tickCallback (internal/process/next_tick.js:61:11)

My config :
Node : v 10.15.1 LTS
MongoDB shell version v4.0.3
Adapt authoring tool 0.6.4 with Adapt framework 2.3.3.

Many thanks,
Didier

Picture of Bradley Barfoot
Re: Cannot create property 'path' on string 'required'
by Bradley Barfoot - Tuesday, 26 February 2019, 9:38 AM
 

Update:

Following tests have been carried out: trying every adapt framework version v2.3.0 and up; Uninstalling all pre-requisites and reinstalling them; Uploading assets works in the asset upload area (not from courses); creating a course allows all options to be used, but courses cannot be saved; I've run node upgrade.js and have no updates to make.

Current config.json:

{

"outputPlugin": "adapt",
"dbType": "mongoose",
"auth": "local",
"root": "C:\\Users\\b.barfoot\\Desktop\\ADAPT2\\Pre-requisites\\adapt_authoring",
"sessionSecret": "81e97f466c352bf5327ab8a4c734fee5ffa74ff22eda6e54eea80d4ab8c9ccf8a0bb011d12cd1cc52fc4c61a5cb5ef000681c1e4df17705830bdbe69b6967afa",
"serverPort": 5000,
"serverName": "localhost",
"dataRoot": "data",
"authoringToolRepository": "https://github.com/adaptlearning/adapt_authoring.git",
"frameworkRepository": "https://github.com/adaptlearning/adapt_framework.git",
"frameworkRevision": "tags/v4.0.1",
"dbName": "adapt-tenant-master",
"useConnectionUri": false,
"dbHost": "localhost",
"dbPort": 27017,
"dbUser": "",
"dbPass": "",
"dbAuthSource": "",
"useffmpeg": true,
"useSmtp": false,
"maxLoginAttempts": 3,
"ckEditorExtraAllowedContent": "span(*)",
"maxFileUploadSize": "200MB",
"ckEditorEnterMode": "ENTER_P",
"masterTenantName": "master",
"masterTenantID": "5c75026e86c9423514920565",
"isProduction": true
}

Further: my package manager version is 6.4.1; my node version is 10.15.1;

 

Picture of Sam Tsiu
Re: Cannot create property 'path' on string 'required'
by Sam Tsiu - Tuesday, 26 February 2019, 10:14 AM
 
I'm thinking it's the newly released version of mongoose that breaks the code. I just installed the latest AT with fw v4.0.1, same error. I had another cooy of at v0.6.4 and fw v4.0.1, installed about a couple weeks ago, worked fine. then I deletee the node_modules folder and resinstalled the packages, not working same error. just a theory, will install an older version of mongoose to test when I get home. sorry for the brevity and typo as typing on a phone. cheers Sam
Picture of Bradley Barfoot
Re: Cannot create property 'path' on string 'required'
by Bradley Barfoot - Tuesday, 26 February 2019, 12:18 PM
 

Wow! That's a great memory you've got. It took a while & I had to install mongo 3.6, but reverting back to mongoose v5.4.8 fixed my issue;

 

Thanks, Sam!

Picture of Sam Tsiu
Re: Cannot create property 'path' on string 'required'
by Sam Tsiu - Tuesday, 26 February 2019, 12:58 PM
 

Yes, I just tested and confirmed it's the latest mongoose release (v5.4.15) introduced the issue.

I just happened to have tested the tool without a problem a couple weeks ago when I got the great news from @tomgreenfield  that the tool now supports the fw v4.

 

Picture of Matt Leathes
Re: Cannot create property 'path' on string 'required'
by Matt Leathes - Tuesday, 26 February 2019, 2:28 PM
 

Well done for figuring that out, Sam! There's a ticket here for anyone wishing to track this issue.

Picture of Tom Taylor
Re: Cannot create property 'path' on string 'required'
by Tom Taylor - Tuesday, 26 February 2019, 6:04 PM
 

This issue has now been patched, and is available in v0.6.5 :)