JavaScript Language Service output window reporting - "Referenced file < .js filename > not found"

For JavaScript Language Service output - is there a way to make it more verbose?

For example, it says:

10:10:21.9070: Referenced file 'scripts\vendor\angular-1.6.9\angular.js' not found.

Open in new window


I need more information on why.

I'm new to this project, so I will answer questions as best I can.

I know the project runs on a Windows Table.  I know it uses XAML.  I know it uses WebView.

I have verified that the files are physically in the path specified, but I don't know if something is changing at runtime to mess with the path:

<head>
    <!--<meta charset="utf-8">-->
    <base href="SmartFormsV4">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--        <script src="scripts/vendor/angular-1.4.9/angular.js"></script>
            <script src="scripts/vendor/ui-bootstrap-1.1.2/ui-bootstrap-tpls-1.1.2.min.js"></script>-->
    <!--<script src="scripts/vendor/angular-1.6.9/angular.min.js"></script>-->
    <script src="scripts/vendor/angular-1.6.9/angular.js"></script>   
    <script src="scripts/vendor/angular-1.6.9/angular-sanitize.min.js"></script>
    <script src="scripts/vendor/angular-1.6.9/angular-cookies.min.js"></script>
    <script src="scripts/vendor/ui-bootstrap-2.5.0/ui-bootstrap-tpls-2.5.0.min.js"></script>
    <script src="scripts/vendor/angular-loading-bar/loading-bar.min.js"></script>
    <script src="scripts/vendor/ui-select/select.min.js"></script>
    <script src="scripts/exif.js"></script>
    <script src="scripts/app.js"></script>
    <script src="scripts/inspections.js"></script>
    <script src="scripts/service.js"></script>
    <script src="scripts/footers.js"></script>
    <link rel="stylesheet" href="scripts/vendor/bootstrap-3.3.6/css/bootstrap.css">
    <link rel="stylesheet" href="scripts/vendor/angular-loading-bar/loading-bar.css">
    <link rel="stylesheet" href="scripts/vendor/ui-select/select.min.css">
    <link rel="stylesheet" href="scripts/app.css">

Open in new window


I am getting the error about "Referenced file ... not found"  for every single .js file.
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lenamtlCommented:
Check if there is any htaccess file that may rewritte url or path may be defined somewhere in the code

or this is maybe related to this
https://madskristensen.net/blog/the-story-behind-_referencesjs
0
Tom KnowltonWeb developerAuthor Commented:
I don't think I have an htaccess file.  Is that specific to Apache Server?

I am running this locally inside of Visual Studio Community 2015.

I don't think a _references.js file is being used, either, but I know what you are talking about.  I did a search for that file and there is no such file.

Interestingly, we have noticed that if we revert from angular 1.6.9 to angular 1.4.9 - the "Referenced file not found" problem goes away.

Unfortunately, this is a temporary fix and not a long term solution...

We are trying to hunt down what it is inside the angular js file that is causing the problem.
0
Eddie ShipmanAll-around developerCommented:
Since you are using VS, I would suggest looking into bundling your JS. Make sure that the paths to your files are correct in your bundle file.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

lenamtlCommented:
check this maybe related to the path in VB project
VisualStudioProject\node_modules\
VisualStudioProject\src\node_modules\

sometimes the problem come from the build, it is using relative path or not...
0
Tom KnowltonWeb developerAuthor Commented:
Since you are using VS, I would suggest looking into bundling your JS. Make sure that the paths to your files are correct in your bundle file.

I can look at doing that.  I'm worried about breaking things.  I don't have much experience with bundling js files.

check this maybe related to the path in VB project
VisualStudioProject\node_modules\
VisualStudioProject\src\node_modules\

sometimes the problem come from the build, it is using relative path or not...

This is in C#.  Not sure wher the "node_modules" or "src" folders would be:

folder struct xaml
0
Eddie ShipmanAll-around developerCommented:
Ok, try doing this, add the ~ at the beginning of the links:
<script src="~/scripts/vendor/angular-1.6.9/angular.js"></script>

Open in new window

0
David Johnson, CD, MVPOwnerCommented:
I don't see your scripts folder? It should be underneath the folder of the calling code since you are using relative links
0
Chinmay PatelChief Technical NinjaCommented:
I think it would have been better to put WPF as a primary topic.  

This is what I believe is happening
1. The error that you are getting, does it affect your build process of the app? - I don't think so.
2. You are loading these SmartFormsv4(from the folder of the same name) inside an HTML file and that HTML file is loaded inside the WPF app's WebView.
3. Have you tried running that HTML file without hosting it inside the WPF app? does it work? or you get the same error?
4. As this is a WPF app, when you build it it will dump the binaries/supporting files in DEBUG or RELEASE folder. Now, if you have not "included" these files in your project i.e. right click(Solution Explorer) each of those files giving you the error and click on "Include in Project", those files will not be copied(again this setting has multiple variations but by default it will choose to copy) to either DEBUG or RELEASE folder and give you runtime errors(which I believe is the case)

Let me know if this does not work out.
0
Tom KnowltonWeb developerAuthor Commented:
I've been pulled away from that and am working on other issues instead.

The core question seems to be "what is different between angular 1.4.9 and 1.6.9, because if I include the 1.4.9 version of angular ... there are NO reference problems.  It is only when I include the 1.6.9 version that this problem happens.

Do you see what I am saying?

>>>1. The error that you are getting, does it affect your build process of the app? - I don't think so.

TRUE ... the application builds and runs, and when it comes to the point where it uses those .js files, it pukes.

>>>2. You are loading these SmartFormsv4(from the folder of the same name) inside an HTML file and that HTML file is loaded inside the WPF app's WebView.

As I understand it - YES, you are correct on all counts.

>>>3. Have you tried running that HTML file without hosting it inside the WPF app? does it work? or you get the same error?

Have not tried this.  Not sure when I will be able to try this.  Not sure how to go about doing this...everything seems pretty tightly coupled...


4. As this is a WPF app, when you build it it will dump the binaries/supporting files in DEBUG or RELEASE folder. Now, if you have not "included" these files in your project i.e. right click(Solution Explorer) each of those files giving you the error and click on "Include in Project", those files will not be copied(again this setting has multiple variations but by default it will choose to copy) to either DEBUG or RELEASE folder and give you runtime errors(which I believe is the case)

As far as I can tell, both the 1.4.9 and 1.6.9 folders and files are included in the Project:

scripts vendor
0
Chinmay PatelChief Technical NinjaCommented:
Hmmm I did read it ... but my mind didn't interpret it :P I was thinking how about we use only 1 version of Angular - I am not sure how it will affect your other systems but if I were you, I'd clean my browser history and also debug OR release folder (Given they are not part of some CI process or automatic deployment).

And to manually test, whichever HTML file is loaded by your WebView just open it in the browser as WebView is nothing but a browser. While your system uses these HTML/CSS/JS files - I don't think there is any server component (ASP.Net / Node / PHP)involved here.

I am generally not very unsure about stuff but your system is one of a kind I have ever seen - using WPF to load HTML Forms (which seemingly does not have a Server backend -or maybe it is there and I just don't see it yet) - so above both statements are my assumptions and I think I would dig around a bit more before I take any further action on those lines.

Hope it helps.
0
Tom KnowltonWeb developerAuthor Commented:
Agreed...

Perhaps we can leave this open for a while.  I was told that there WAS a fix for the 1.6.9 angular.js file incompatibility which involved editing the source of the 1.6.9 angular.js file itself.  This seems like a hack, and the source of problems later down the road.  It must have been the only way they could get the 1.6.9 file to load!  This project does not have the modified .js file yet ... which means now there will be 2 copies if of the file.  Which again -- makes the hair stand-up on the back of my neck.  LOL.

I've been with this company -- 3 weeks now.  : /
0
Chinmay PatelChief Technical NinjaCommented:
All the best then 😉.
PS:Hopefully you will be able to to close it via manual editing.
0
Tom KnowltonWeb developerAuthor Commented:
>>>Hopefully you will be able to to close it via manual editing.

I am not sure what you meant.
0
Chinmay PatelChief Technical NinjaCommented:
You said there might be a possible bug fix in which you can edit the  source of the Angular.js file. I was referring to that.
0
lenamtlCommented:
Hi,

here are the migration to 1.6 instructions https://code.angularjs.org/1.6.10/docs/guide/migration

You can try the latest version 1.7 maybe this was a bug and this is now fixed.
https://github.com/angular/angular.js

You can also ask your question on  https://github.com/angular/angular.js/issues
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tom KnowltonWeb developerAuthor Commented:
lenamtl:

Good stuff!

I'll mention 1.7 as an option.
0
Eddie ShipmanAll-around developerCommented:
So, the migration docs state that the jqLite is more aligned with jQuery 3+ and you are using jQuery 2.2 there could be an incompatibility there?
0
Tom KnowltonWeb developerAuthor Commented:
Perhaps!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WPF

From novice to tech pro — start learning today.