When I run my index.html file in my (typescript) Angular 2 app which is also a Parse.com app (It has the cloud and public, parse.local and parse.project directories etc) it runs fine. But when I try to deploy it to Parse.com it doesn't deploy.
A lot of errors show in the terminal saying Bad file name for the files in the node_modules folder.
Is my node modules folder in the wrong directory? Or do I need to get rid of all of the files that have a bad file name according to parse.com?
Here is my project file structure:
Here is a sample of the error log in the terminal after typing parse deploy from the root directory of my project - The actual error log is too big to paste the whole thing. Notice that it says
Open file xxx - too many open files
open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/define-property.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/event-target.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/file-reader.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/functions.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/geolocation.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/mutation-observer.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/promise.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/property-descriptor.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/register-element.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/websocket.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/utils.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/zone.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/zones/long-stack-trace.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/package.json:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/package.json: too
many open files | open
/Users/Ben/development/whatwegrowangular2/public/tsconfig.json: too
many open files
Here is another sample of a different error from the same terminal:
Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js
| Bad file name:
node_modules/ua-parser-js/test/browser&mediaplayer-test.json Will
retry in 1 seconds
EDIT: I moved the node modules that were actually used out of the node_modules folder and deleted the node_modules folder. The index.html file still runs and looks fine. But when I try to deploy to parse.com, I get this error now:
Finished uploading files Deploy failed with error: You have 3029
hosted files but are limited to 500 Will retry in 0 seconds.
I have to load all node_modules via a CDN script tag in my html file, not by having the actual node_module files in my project.
At this stage I have these two script tags and it kinda works (All that is on the page is an angular 2 component which has a bootstrap danger button - It works fine it just loads kinda slow):
<script src="https://code.angularjs.org/2.0.0-alpha.47/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system-csp-production.js"></script>
I get these errors in the console:
Uncaught ReferenceError: System is not defined bootstrap.min.js:6
Uncaught Error: Bootstrap's JavaScript requires jQuery bundle.js:27364
Angular 2 is running in the development mode. Call enableProdMode() to
enable the production mode. angular2.dev.js:138
http://whatwegrowangular2.parseapp.com/app/bundle.js did not call
System.register or AMD define Error loading
http://whatwegrowangular2.parseapp.com/app/bundle.js
Please comment with any other cdn script tags to include in my index.html file to get rid of all errors. Thanks.
Here is my full index.html file:
<html>
<head>
<title>Angular 2 QuickStart</title>
<!-- 1. Load libraries -->
<script src="https://code.angularjs.org/2.0.0-alpha.47/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system-csp-production.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- 2. Configure SystemJS -->
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/bundle')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>
Related
I have created jest code coverage report using command npx jest --coverage. It creates coverage directory in the root as below:
laravel_project
- app
- config
- coverage
-- lcov-report
--- index.html
--- prettify.js
--- prettify.css
When I open the index.html on my local the report looks proper as below. (JS & CSS created by the command loads properly)
I am trying to display the same code coverage report using a route as below.
Route::get('/reports/jest-coverage', function () {
return File::get(base_path('coverage/lcov-report/index.html'));
});
but CSS and JS included in the index.html breaks as Laravel doesn't allow to load resourses outside the public directory.
The JS & CSS files are included as below in the index.html:
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<script src="prettify.js"></script>
How I can achieve this without modifying coverage directory?
Is there any way in Laravel to achieve this?
My Laravel project run correctly on my localhost but when I upload on 000webhost it just show me html data and css,js,images file don't. This is a example about css files, I use this to link css files:
<link href="{{asset('public/frontend/css/bootstrap.min.css')}}" type="text/css" rel="stylesheet">
Here is my file structure
-app
-bootstrap
-config
-database
-public
--frontend
---css
----bootstrap.min.css
----some files css in here
---fonts
---images
---js
-public_html
-resources
--views
---index.blade.php
-routes
-storage
...
When I run it take 2 errors:
Refused to apply style from
'https://...000webhostapp.com/public/frontend/css/bootstrap.min.css'
because its MIME type ('text/html') is not a supported stylesheet MIME
type, and strict MIME checking is enabled.
And
Failed to load resource: the server responded with a status of 404 ()
All css,js,image files have 2 errors.
Solved!! I really don't understand but i just move public folder into public_html folder and it worked
I am developing a Web Application. I am using Laravel 5.3. I also want to use SASS. This is my first time of using SASS. I learned from this tutorial- http://blog.teamtreehouse.com/the-absolute-beginners-guide-to-sass. Now I am trying to integrate SASS with Laravel. I just started building project. So I decided to use this one - https://github.com/panique/laravel-sass.
I included this in composer.json
"require-dev": {
"panique/laravel-sass": "1.0"
}
I added this line in public/index.php
SassCompiler::run("scss/", "css/");
So my index.php in public folder look like this
Then I run "update composer" command in terminal. Installation worked well in terminal.
So now I need to try on SASS and make sure it is working or not.
So I created two file in public folder.
public/css/style.css
and
public/scss/style.scss
Then I created a view, hello.blade.php. This is the html.
<!DOCTYPE html>
<html>
<head>
<title>SASS</title>
<link rel="stylesheet" type="text/css" href="{{ url('css/style.css') }}">
</head>
<body>
<h1 class="heading">Let's sass. Just change color.</h1>
</body>
</html>
Then I added this lines in public/scss/style.scss
$red: #FF4848
.heading
color:$red
Then I configure Laravel route like this.
Route::get('hello', function () {
return View('hello');
});
When I access the URL from browser, it is giving me this error.
Fatal error: Uncaught Exception: parse error: failed at $color : red
line: 1 in
C:\xampp\htdocs\whatsuppathein\vendor\leafo\scssphp\scss.inc.php:4108
Stack trace: #0
C:\xampp\htdocs\whatsuppathein\vendor\leafo\scssphp\scss.inc.php(2761):
scss_parser->throwParseError() #1
C:\xampp\htdocs\whatsuppathein\vendor\leafo\scssphp\scss.inc.php(121):
scss_parser->parse('$color : red\r\n\r...') #2
C:\xampp\htdocs\whatsuppathein\vendor\panique\laravel-sass\sass-compiler.php(53):
scssc->compile('$color : red\r\n\r...') #3
C:\xampp\htdocs\whatsuppathein\public\index.php(50):
SassCompiler::run('scss/', 'css/') #4 {main} thrown in
C:\xampp\htdocs\whatsuppathein\vendor\leafo\scssphp\scss.inc.php on
line 4108
What is wrong with my code?
When I replace this line
SassCompiler::run("scss/", "css/");
with this
SassCompiler::run("public/scss/", "public/css/");
in public/index.php, it is not throwing error. But not changing any CSS. Not changing the font color.
Laravel uses gulp to transpile dependencies and it comes built it when you do npm install from your project direcftory.
Open up your resources/scss/app.scss file and you can perform #import statments to your own files.
The gulp.js file in your project's root directory contains the sass transpiling.
I'm getting mad with this issue.
Basically there are some css and js files which are opened correctly from laravel. But some other js and css files are recognized as routes!
For example: http://localhost:8000/assets/ammap/themes/light.js
I'm using the following code to access assets from templates:
<script type="text/javascript" src="{!! asset("assets/ammap/themes/light.js") !!}"></script>
Obviously the path is correct and the file exists.
I've solved the problem.
I'm using OS X and it was a permission issue.
chmod -R 0777 public
Then set everyone to "Read & Write" into file permissions.
I am new to Tomcat and using Handlebars.js. I am making a prototype page to test working with handlebars.js. I have installed a vanilla version of Tomcat 7 running on Windows 7. I have added my page its related js css and image files and put them in the webapps folder inside a MyApp folder.
so we have
|
-- webapps
|
-- MyApp
|
-- index.html
|
-- css/
|
-- img/ - all my sprites are here
|
-- js/ - contails all my vendor and prsonal js files
|
-- tmpl/ contains all my handlebars template (*.tmpl) files
When I load the page the index file loads, the js, css and image files are getting accessed. However the tmpl file is getting a 404 error
HTTP Status 404 - /MyApp/tmpl/MainView.tmpl
type Status report
message /MyApp/tmpl/MainView.tmpl
description The requested resource is not available.
Any thoughts? I have already added the tmpl mimetype as plain text.
Thanks,
Jeff