ember build fails after code change - javascript

I am trying to run ember locally on my Windows 7 machine
When I load my app for the first time, the ember build is successful and ember serve starts and I can access my app.
However, as soon as I make even a small change in my code and try to refresh, I get the following error;
ENOTEMPTY, directory not empty
'C:\MyCode\myProj\tmp\tree_merger-tmp_dest_dir-cQOjj10S.tmp\modules\ember-validations\validators'
I am using Sublime Text editor and have added the following in Preferences: Settings > User
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "tmp/*"]
While I have seen other solutions like
Disable Windows Search Index for temporary files (Windows does not seem to be already indexing my tmp folder)
Disable Windows Defender for temporary files
Please note I do not have Admin rights on my system (it's a company provided system).
I do have anti-virus running, but cannot disable it.
So kindly suggest any fixes accordingly.

Related

Fix for : System.Web.HttpException: The file has not been pre-compiled, and cannot be requested

We published our website and everything worked fine. After few days, something strange happened. we're getting "The file 'xxx.cshtml' has not been pre-compiled, and cannot be requested."
Resetting application pool, even restarting IIS didn’t help us to resolve the problem. Even resetting the Web server machine didn't fix the problem. but when we re-copying the published files again, web site starts working again.
We compared the problem website files with the new files, all are the same. nothing is missing. so every two-three days, we are getting the same error and the only way we can fix it is recopying the files again.
We even copied website when we got an error and then create another website based on those files and it works fine!
Any suggestion what can cause this problem?
Thanks in advance.
About the error
System.Web.HttpException: The file has not been pre-compiled, and cannot be requested
This error will come when a reference is specified in web.config and
deployment folder/site does not contain these dlls installed in the
system or bin folder does not contain them(if they are private
assemblies). For Example: (add assembly="Namespace1.NameSpace2,
Version=x.x.x.x, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/)
if your web.config contains any assemblies like this and deployed
server doesnot contain these assembiles in bin or GAC, then this error
will occur.
Scenarios:
Here are some possible scenarios that will generate this error:
When we publish the website with the "updateable" check OFF and then
copy some files on deployment location that has some markup or code in them. By
putting the "updateable" check OFF we instruct the asp.net compiler to compile all the markup and code into dll files so that further on asp.net would not consider runtime compilation of content. But if it needs to (due to the presence of such content) it will throw that error.
The second situation is when we have a web application configured in
VS.Net to run directly off IIS (the http project) and then we publish it to the same location again with the "updateable" checked OFF. There will be development files at same location which will cause similar errors.
Another situation is where we have a precompiled website and within the
root folder of it we have another folder that has content for another asp.net
application but isn¡¯t marked as application in IIS. ASP.Net tracks asp.net
applications when running on IIS by virtual directories in IIS marked as applications. A child folder having un-compiled content within a parent
application which is precompiled will again cause this error.
Source: Microsoft Support
Apparently, it is another scenario where the cause is related to missing ReportViewer .dll references
Solutions
Some people talks about adding manually the missing missing assembly files.
i found out one thing that while publishing the application it does
not copy all of the dependent assemblies in the bin folder.So i just
copied them manually to the server and now every thing is working
Other people, somehow fixed this installing "Microsoft Web Service Enhancements v3.0". Downlaod here. It probably provides missing required .dll
Here, somebody fixed it, enabling "Create a separate assembly for each page and control output" in the Deployment Options

Aptana Studio 3 - SFTP - Preview not displaying CSS/JS. What's wrong?

I have a website hosted that I am using Aptana to connect to the server via SFTP and edit the files there. When I preview the html file, it seems to store a temp version of the file on my local drive:
file:///C:/Users/username/AppData/Local/Temp/aptanavfs/aptanavfs2715860739108955789index.html
instead of using the live version... and this seems to cause it to not load the CSS/JS (I guess it's not making a copy of these files to the temp path).
What's going on? When I view the site live on the internet, everything is working fine.
The files from your remote server might not be synchronized with the files on your computer.
Check your Synchronization options to ensure you tell Aptana to 'sync from your remote site to your machine' - if you do not have all the files from the server on your computer, you need to do this at least once before you start working on your changes.
After this, you will want to decide how to keep the changes made on your computer in sync with the server (either manually upload them yourself, or tell Aptana to automatically synchronize them)
Check this page for a brief tutorial on how to set up the sync options (step 7):
http://www.danielrosca.ro/blog/en/aptana-studio-and-ftp-server/

Load local javascript file in chrome for testing?

I am trying to test some JavaScript on my local computer using the Chrome browser but Chrome will not load local resources. Is there an easy work around for this?
If you are trying to just test the functionality of your JavaScript file: create a blank HTML file, add a link to your JS file as you would normally load a JS file from HTML, and open the HTML file in Chrome. Go to the JavaScript console. You'll be able to interact with the functionality of your JS code as usual. You wouldn't need to set up a server for this. If still not clear, here's an example:
<html>
<head>
<script type = "text/javascript" src = "path/to/your/jsfile"></script>
</head>
</html>
You can use a light weight webserver to serve the file.
For example,
1. install Node
2. install the "http-server" (or similar) package
3. Run the http-server package ( "http-server -c-1") from the folder where the script file is located
4. Load the script from chrome console (run the following script on chrome console
var ele = document.createElement("script");
var scriptPath = "http://localhost:8080/{scriptfilename}.js" //verify the script path
ele.setAttribute("src",scriptPath);
document.head.appendChild(ele)
The script is now loaded the browser. You can test it from console.
To load local resources in Chrome when just using your local computer and not using a webserver you need to add the --allow-file-access-from-files flag.
You can have a shortcut to Chrome that allows files access and one that does not.
Create a shortcut for Chrome on the desktop, right click on shortcut, select properties. In the dialog box that opens find the target for the short cut and add the parameter after chrome.exe leaving a space
e.g. C:\PATH TO\chrome.exe --allow-file-access-from-files
This shortcut will allow access to files without affecting any other shortcut to Chrome you have.
When you open Chrome with this shortcut it should allow local resources to be loaded using HTML5 and the filesystem API.
For security reasons, modern browsers won't load resource from locally running HTML files (files using file:// protocol in the address bar).
The easiest way to get a modern browser to load and run JavaScript files in local HTML files is to run a local web server.
If you don't want to go through the trouble of setting up a Node or Apache web server just to test your JavaScript, then I'd suggest you install Visual Studio Code and the Live Server extension.
Visual Studio Code
Visual Studio code is a source code editor for pretty much any programming language under the sun. It has built-in support for JavaScript, HTML, CSS, TypeScript, and almost any kind of language used for Web development.
Install Visual Studio Code
You can get the Visual Studio Code editor for your platform from https://code.visualstudio.com/. It supports Windows, Linux, and Mac. I think it also works on your Surface Pro if that's your thing.
Add the Live Code Extension
After installing VS Code, you can add the Live Code code extension using the Extension panel (Ctrl+Shift+X in Windows) in Visual Studio Code.
Live Server Extension
After adding the extension, you should see a "Go Live" button in the bottom-right corner of the Visual Studio Code IDE (as shown in the above screenshot).
Open in Code
Open the root folder where your HTML and JavaScript files exist in Visual Studio Code and click the "Go Live" button. Optionally, you can right-click the HTML file in the Explorer (Ctrl+Shift+E) and select Open with Live Server from the pop-up menu that appears.
Open with Live Server
This should create a locally running web server and open the file or folder in your web browser. If your file paths are correct, your JavaScript files should also load and run correctly.
Troubleshooting
If for some reason, the page doesn't load in your favorite browser, check that the address and port number are correct. If the Live Server is running, it should display the port number in the bottom-right corner of the Visual Studio IDE. Make sure the address in your browser says http://127.0.0.1:<PORT>/index.html where <PORT> has the same number as shown in the status bar in Visual Studio Code.
Use Chrome browser and with the Web Server for Chrome extension, set a default folder and put your linked html/js files in there, browse to 127.0.0.1:8887 (0r whatever the port is set at) in Chrome and open the developers panel & console. You can then interact with your html/js scripts in the console.
The easiest workaround I have found is to use Firefox. Not only does it work with no extra steps (drag and drop - no muss no fuss), but blackboxing works better than Chrome.
You can do it by a feature of chrome's DevTools: Snippets
Create a new snippets
Copy and paste the file you would like to execute.
Hit CtrlEnter to run the snippet
Windows 8.1 add:
--allow-file-access-from-files
to the end of the target text box after the quotes.
EX: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files
Works like a charm
Running a simple local HTTP server
To test such examples, one needs a local webserver. One of the easiest ways to do this is offered by Python's SimpleHTTPServer (or http.server, depending on the version of Python installed.)
# 1. Install Python 3 & use:
python3 -m http.server
# On windows, instead of "python3" try "python" or "py -3"
# If you installed python version 2 then use:
python -m SimpleHTTPServer
# 2. To serve a specific folder use the --directory flag:
python3 -m http.server --directory /Users/junaid/WebstormProjects
# Note: I use MacOs & I have given the absolute path to my projects folder & I was able to serve my desired folder.
Here's what I did by creating 2 files in the /sandbox directory:
First file: sandbox.js
Second file: index.html
const name = 'Karl'
console.log('This is the name: ' + name)
<html>
<head>
<script type = "text/javascript" src = "file:///Users/karl/Downloads/sandbox/sandbox.js"></script>
</head>
</html>
You can then use Chrome or any browser to inspect and debug/console your code!
setup
You will want to serve the file from a web server. Everything else will be quirky workarounds that might differ greatly from the final result. On the web, files are being served via web servers. You'll want to mimic that locally.
Since you're apparently (at least part-time) being a web developer, do yourself a massive favour and install node, if you haven't already. It comes bundled with the npx binary, which we'll use. Make sure you have a recent LTS version. Bonus points for using n, which will make it easy to stay up to date with your versions, and even switch them as you need.
steps to take
Inside the folder where your file is located: npx http-server -c-1
You can now access the file at http://127.0.0.1:8000/filename
Last thing to do is make the browser load the file. Magesh's answer works well for that, but I would recommend putting that snippet into a "custom js" extension. This one has served me well so far.
With everything in place, simply reload the page to get an updated version
of your local file.
Note: this question comes top on google when you search for "chrome read local css without server". So...
If you really want to serve a local webpage and load its CSS and JS, and you really do not have or don't want to use a http server, then don't load the scripts nor styles; inline them.
Instead of something like this:
<link rel="stylesheet" href="somefile.css">
Define the style like:
<style>/*Here goes all the CSS file content*/</style>
And the same with the JavaScript files. The HTML file will be larger, but it will work.
Basically you just have to copy the file contents and paste it inline.
You really should use a server, but if you are forced to, you can use this method.
If you still need to do this, I ran across the same problem.
Somehow, EDGE renders all the scripts even if they are not via HTTP, HTTPS etc...
Open the html/js file directly from the filesystem with Edge, and it will work.
for my use case, i need to startup a local server, create working an interactive html page, and open it for the user to be able to interact with it. the problem was how to set the local server's web root to my temp working folder where i create these dynamic files. this was a quick and dirty solution.
In the below code, LOCAL_WEB_DIRECTORY is essentially the root. and i then create/copy the files i want to open in the brower to that directory + /templates
import webbrowser
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
httpd = ThreadingHTTPServer(('', 8001), lambda *_: SimpleHTTPRequestHandler(*_, directory=config.LOCAL_WEB_DIR))
server_thread = threading.Thread(target=httpd.serve_forever, daemon=True)
server_thread.start()
webbrowser.open('http://localhost:8001//templates/' + work_html)
while True: sleep(1)
Not sure why #user3133050 is voted down, that's all you need to do...
Here's the structure you need, based on your script tag's src, assuming you are trying to load moment.js into index.html:
/js/moment.js
/some-other-directory/index.html
The ../ looks "up" at the "some-other-directory" folder level, finds the js folder next to it, and loads the moment.js inside.
It sounds like your index.html is at root level, or nested even deeper.
If you're still struggling, create a test.js file in the same location as index.html, and add a <script src="test.js"></script> and see if that loads. If that fails, check your syntax. Tested in Chrome 46.
The easiest way I found was to copy your file contents into you browser console and hit enter. The disadvantage of this approach is that you can only debug with console.log statements.
Look at where your html file is, the path you provided is relative not absolute. Are you sure it's placed correctly. According to the path you gave in the example above: "src="../js/moment.js" " the JS file is one level higher in hierarchy.
So it should be placed as following:
Parent folder
sub-folder
html file
js (this is a folder)
moment.js
The double dots means the parent folder from current directory, in your case, the current directory is the location of html file.
But to make your life easier using a server will safe you troubles of doing this manually since the server directory is same all time so it's much easier.

Webstorm Remote Debugging + edit local javascript file while debugging

I've been working through the javascript remote debug tutorials for WebStorm / IntelliJ(numbers.js)
I've managed to get remote debugging working successfully, however there is one thing that is making life difficult.
When I'm debugging numbers.js in WebStorm(I've also tested in IntelliJ and have same result) there is a little lock icon which I guess implies that the file is read only. At the moment, it is slow and painful to go full cycle on the development / deploy process of:
code modification on local file
upload
debug on locked remote fuile
switch tabs in WebStorm to local file
code modification on local file
What I want to do at least is debug on local file, so that I can make changes while debugging and then quickly upload and repeat.
# the tutorial
http://wiki.jetbrains.net/intellij/Remote_JavaScript_debugging_with_WebStorm_and_PHPStorm
the numbers.js file does not have the locked symbol in the tab like I am seeing in my locally running WebStorm.
Anyone else have this problem? Anyone advise how they got WebStorm working so they can make changes to the local file while stepping through and debugging?
Thanks
Most likely you open the file from the Scripts tab in the Debugger panel and place breakpoints there. You should place breakpoints in the original file instead.
Deployment can be automatic (on Save) or you can use In Place configuration when your server root is configured to the project folder.
Another important thing is the local file to remote URL mapping in the Debug configuration. Note that in the wiki tutorial Remote URL is set to the full URL including the http:// and server name.
With In Place deployment or with Automatic Upload and correct mappings you can debug your scripts with zero turnaround time. Make a change, switch to a browser, Refresh (file is saved automatically as Settings | General | Save files on frame deactivation is enabled by default).
If it doesn't work this way for your project, please contact JetBrains support and send a sample project to reproduce this problem, also describe your server and deployment settings.

run JS app locally in IE

I'm using GWT 2.1 and IE to test the default hello world GWT app.
I compile the default Hello world GWT app and then go to HTML file and
open it with IE.
I get a red warning message "Your web browser must have JavaScript
enabled in order for this application to display correctly."
I had to allow the active content to be running in order to see the
app screen.
things are a bit different if I run the app via \.psf\Home
\myFile.htm which is path to my Parallel's "shared directory" .. I
wouldn't see such warning.
also running in dev mode seems not to raise this warning message.
it seeems IE doesn't like people opening JS-laced web pages from the local drive. Probably a security concern, I would imagine.
there is a detailed article that tackles this issue at http://www.phdcc.com/xpsp2.htm
i tried the method of Mark of the web by adding these two lines at the
begining of myfile.html file :
<!-- saved from url=(0014)about:internet -->
<!-- saved from url=(0016)http://localhost -->
but when i add these two lines and then compile app and open the html file with IE the web app doesn't show even though the warning message is gone!
The reason probably is that (by default) a GWT app is loaded within an iframe, i.e. as another HTML page (*.cache.html), which doesn't contain the MotW.
i Tried using the "xs" or "xsiframe" linker, i.e. add one of these lines to our
*.gwt.xml:
<add-linker name="xs" />
<add-linker name="xsiframe" />
Those linkers use *.cache.js" files, so the MotW in our host page should be enough. but The "xs" linker prevents us from using DevMode .
adding line to xml module file make IE warning message go away and can run app locally with IE.however the line above prevent our app to run in dev mode with IE .
any Idea how we can have the app works both in dev mode and web mode?
i'm not keen on having two xml module files one for dev mode and one
for web mode. but would like to know how to do that if i have to?
also interested in any other method to run javascript apps locally with IE.
thanks
Have you tried enabling Active Content from local files in the advanced tab of the Internet Options?
This worked for me:
SO - Activex content in local web page
The take away is:
<!-- saved from url=(0014)about:internet -->
Must be the first line in the file and the file must have
\r\n (CRLF)
line endings.
you could download and set up xampp and put your files in the htdocs folder. This will give you a local server at your loopback address. This will prevent IE from doing all of its acrobatics concerning locally run js files, as it will think it is accessing a remote website.

Categories

Resources