Search Posts

Category: gulp

Gulp-Uglify – Unable to minify Javascript Angular 1.6.8

Hi I am trying to minify my app.js file using gulp uglify, I used pump to get error details and it gives me an error on Line 2 GulpUglifyError: unable to minify JavaScript Caused by: SyntaxError: Unexpected token: name (app) File: /Users/Alexander/OneDrive/Alexander/scripts/app.js Line: 2 Where as Line 2 in my app.js is let app = angular.module(“app”, [“ngRoute”]); here is my complete app.js file let app = angular.module(“app”, [“ngRoute”]); app.config(function ($routeProvider) { $routeProvider .when(“/”,{ templateUrl : […]

node server directory local vs dev, angular 1 best practice questions

I am updating an angular 1.6 web app with gulp. I have my gulp watch task setup for local dev with browser-sync for auto-reloading my local source files. I am in the process of making a new gulp task build-prod minify/concat, etc. It seems like all the tutorials and readme’s out there focus on either “local” or “production” setups. So, I am trying to figure out and read between the lines. What are some of […]

Failed to load template: while serving build app

So I’m getting a 404 error in serving my build app. In the development its not throwing any error so i’m kinda lost on how to solve this. Been tackling this error for days now and i can really use some help. And my question is that why is it still calling the /app/dashboard/dashboard.html even though its already compress to a build state ? I used hottowel to create the project. I used gulp build […]

Gulp/Angular index.html setup causing it to load angular more than once?

I have run into an issue with my gulp setup, converting a functional app without any build environment. On load of the default “home” page, everything is fine. However, when I click on my internal navbar links, it errors out with the message: WARNING: Tried to load angular more than once. So, I am curious if it’s my index.html file that is creating the issue. <!DOCTYPE html> <html ng-app=”app” ng-controller=”controller_index”> <head> <link rel=”stylesheet” href=”/css/materialize.css”> <link […]

How can I debug Uncaught Error: [$injector:modulerr] on a compiled js file?

I compiled my all my js, and css using Laravel Elixir via Gulp While loading my site, I kept seeing this error on my console all-04432621a2.js:1 is a compiled file. Link http://errors.angularjs.org/1.5.6/$injector/modulerr?p0=signinApp&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.6%2F%24injector%2Funpr%3Fp0%3De%0A%20%20%20%20at%20http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A412%0A%20%20%20%20at%20http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A18991%0A%20%20%20%20at%20i%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A17735)%0A%20%20%20%20at%20r%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A17969)%0A%20%20%20%20at%20Object.invoke%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A18059)%0A%20%20%20%20at%20i%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A17204)%0A%20%20%20%20at%20http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A17328%0A%20%20%20%20at%20i%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A860)%0A%20%20%20%20at%20l%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A17105)%0A%20%20%20%20at%20Be%20(http%3A%2F%2Fbheng.dev%2Fbuild%2Fassets%2Ffe%2Fjs%2Fall-04432621a2.js%3A1%3A19151 How do I debug this further? Source: AngularJS

Angular unit test with karma jasmine and browserify

I am using this repo code to apply browserify in app. I want to write unit test for my app for this I include karma and karma browserify. My folder structure is : karma.config.js module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: ”, // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: [‘jasmine’ , ‘browserify’], // list of files / patterns to load […]

watch changes for incremental build using webpack and gulp for angular 5 app – AOT

In order to compile my angular app AOT, I’m using webpack and gulp. I noticed that the watch step of webpack is not working so well, sometimes work and sometimes not, and when it work the files are not being updated on the site. Please see the code bellow and tell me if there is anything I can do with minimum changes? or should I have to write something new? packages.json { “name”: “my-app”, “version”: […]

Yeoman/Gulp throwing ‘spawn gulp ENOENT’ error on a Mac

Please note: I do see this question as well as this one but those were both instances where the developer was on Windows, and the solution was Windows-specific. I am on a Mac! Please don’t closevote as a duplicate!!! Mac 10.12.6 here. I’m new to AngularJS (v1.x) and am trying to follow this tutorial on using Yeoman to create an internationalized AngularJS app. I install the Yeoman AngularJS generator and create a directory for my […]

gulpfile network issue during WebSocket handshake: Unexpected response code: 400 @ browser-sync

Facing below error while requesting .net web API post request with localhost in angular, same code is working fine with other machine at my home with different network :- WebSocket connection to ‘ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=E7Doi0kt1WqvOeT2AAAB’ failed: Error during WebSocket handshake: Unexpected response code: 400 n.doOpen @ browser-sync-client.js?v=2.18.1:2 // Task to run build server for testing final app gulp.task(‘build:serve’, function () { browserSync({ server: { baseDir: “./build/” } })}) Source: AngularJS

Error blank page with gulp dist:serve

vendor-bed50f88.js:31 Uncaught Error: [$injector:modulerr] Failed to instantiate module angularMaterialAdmin due to: Error: [$injector:nomod] Module ‘angularMaterialAdmin’ is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.6.4/$injector/nomod?p0=angularMaterialAdmin http://errors.angularjs.org/1.6.4/$injector/modulerr? Source: AngularJS

Next Page »