Potential error in _CreateOrUpdateRequirements.cshtml

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
I downloaded the .zip-file from the main page and I am now trying to get nopCommerce up and running as a local project. I am currently struggling with the following section in _CreateOrUpdateRequirements.cshtml


<div class="interaction-type pull-left clearfix">
                            <span class="pull-left margin-r-10">@T("Admin.Promotions.Discounts.Requirements.InteractionTypeInGroup")</span>
                            <select class="form-control input-sm pull-left" id="interactiontype{{= DiscountRequirementId }}" name="interactiontype{{= DiscountRequirementId }}"
                                    onchange="changeInteraction({{= DiscountRequirementId }}, ${ParentId ? ParentId : 'null'}, this.value)">
                                {{each AvailableInteractionTypes}}
                                {{if Selected}}
                                <option value="${Value}" selected>${Text}</option>
                                {{else}}
                                <option value="${Value}">${Text}</option>
                                {{/if}}
                                {{/each}}
                            </select>


I am using VS2019 16.5.4 and this particular section throws quite some errors.

\_CreateOrUpdate.Requirements.cshtml:197 ',' or '}' or property name is expected
\_CreateOrUpdate.Requirements.cshtml:197 ',' or '}' or property name is expected
\_CreateOrUpdate.Requirements.cshtml:197 Unexpected token
\_CreateOrUpdate.Requirements.cshtml:197 Unexpected token
\_CreateOrUpdate.Requirements.cshtml:197 ; expected
\_CreateOrUpdate.Requirements.cshtml:197 Unexpected token
\_CreateOrUpdate.Requirements.cshtml:197 ; is expected
\_CreateOrUpdate.Requirements.cshtml:214 ',' or '}' or property name is expected
\_CreateOrUpdate.Requirements.cshtml:214 ',' or '}' or property name is expected
\_CreateOrUpdate.Requirements.cshtml:214 Unexpected token
\_CreateOrUpdate.Requirements.cshtml:214 Unexpected token



Can I ignore these error messages or does this section need adjustment? Please do provide a solution since I am not that well-versed in JS/TS. Thanks in advance for your help.
3 years ago
Are you changing something ?
Do you mean warnings - Close all files when you build the solution
3 years ago
Hi,

unfortunately the labels say error not warning. As for making changes, I haven't touched the file yet, it is the (still) the same file as downloaded in the .zip-folder. I did run package updates and so on, though.

Are there any other information you might require that I can provide? Please do feel free to let me know. I appreciate the help.

Kind regards
Chris
3 years ago
Updating all packages with packagemanager for solutions may have thrown up some incompatibilities...

I would download again, load solution, and re-build solution. (without updating any packages). Just let the packages all download/restore as per the nop defined versions.

Cres wrote:
Hi,

unfortunately the labels say error not warning. As for making changes, I haven't touched the file yet, it is the (still) the same file as downloaded in the .zip-folder. I did run package updates and so on, though.

Are there any other information you might require that I can provide? Please do feel free to let me know. I appreciate the help.

Kind regards
Chris
3 years ago
Thanks a mil for your reply. As suggested, I opened the file solution previously downloaded from the web page without any updates. Unfortunately, I got the same error(s):

Solution NopCommerce.sln
    Project Nop.Web
     _CreateOrUpdate.Requirements.cshtml:197 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:197 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:197 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:197 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:197 ; expected
     _CreateOrUpdate.Requirements.cshtml:197 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:197 ; is expected
     _CreateOrUpdate.Requirements.cshtml:214 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:214 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:214 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:214 Unexpected token
  

Not sure what I am missing here.

Kind regards

Chris
3 years ago
Jon is probably on to something, looking at the page it uses the jquery Template plugin which google says is no longer maintained.  

First I would hit F12 to open the browser's devtools and check the Network / Debugger tabs to make sure this script is getting loaded:
lib/jquery-tmpl/jquery.tmpl.min.js


I don't know if updating packages would overwrite js libraries, but if it is getting loaded then I would copy the original files into your solution and try again.  If it still doesn't work then use the browser devtools to set a break point at line 187 and step through the code to see where it's going wrong.
3 years ago
I just downloaded the 4.3 source zip, and it worked first time for me. I can only suggest one of these:

-didn't download properly - download again
-didn't unzip properly (maybe try a different zip program) Antivirus blocking?
-nugent packages restore interrupted and somehow corrupt - not finishing
-Nop.Web not startup project
-Disk space preventing build?
-something else weird with VS

Cres wrote:
Thanks a mil for your reply. As suggested, I opened the file solution previously downloaded from the web page without any updates. Unfortunately, I got the same error(s):

Solution NopCommerce.sln
    Project Nop.Web
     _CreateOrUpdate.Requirements.cshtml:197 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:197 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:197 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:197 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:197 ; expected
     _CreateOrUpdate.Requirements.cshtml:197 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:197 ; is expected
     _CreateOrUpdate.Requirements.cshtml:214 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:214 ',' or '}' or property name is expected
     _CreateOrUpdate.Requirements.cshtml:214 Unexpected token
     _CreateOrUpdate.Requirements.cshtml:214 Unexpected token
  

Not sure what I am missing here.

Kind regards

Chris
3 years ago
I just reviewed my dev copy of this file in VS2019, environment shows warnings on these lines as possible JS script errors. It kinda looks like just weird VS editor not liking the syntax entered at these lines. If not causing an actual error at browser, it is probably safe to ignore.
3 years ago
Get the same warnings in v4.2 VS Dev environment.
3 years ago
did you check this?

af1racing wrote:
First I would hit F12 to open the browser's devtools and check the Network / Debugger tabs to make sure this script is getting loaded:
lib/jquery-tmpl/jquery.tmpl.min.js


If it still doesn't work then use the browser devtools to set a break point at line 187 and step through the code to see where it's going wrong.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.