Getting Failed to load %5Bobject%20Object%5D on Webpack generated js hosted in express due to stylus styles - express

I am working on augmenting the example found here. So first of all it works great if I call npm start. Now I wanted to try and get it to work with an existing ExpressJS project. To do this in a quick and dirty way I copy the three js files to the ./public/javascripts folder and create the following index.jade...
extends layout
block content
my-app Loading....
script(type="text/javascript", src="http://localhost:3000/javascripts/polyfills.js")
script(type="text/javascript", src="http://localhost:3000/javascripts/vendor.js")
script(type="text/javascript", src="http://localhost:3000/javascripts/app.js")
but now I get....
Error: Uncaught (in promise): Failed to load %5Bobject%20Object%5D
at resolvePromise (zone.js:538)
at PromiseCompleter.reject (zone.js:515)
at application_ref.js:349
at ZoneDelegate.invoke (zone.js:323)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.js:48)
at ZoneDelegate.invoke (zone.js:322)
at Zone.run (zone.js:216)
at zone.js:571
at ZoneDelegate.invokeTask (zone.js:356)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (ng_zone_impl.js:39)
at ZoneDelegate.invokeTask (zone.js:355)
at Zone.runTask (zone.js:256)
at drainMicroTaskQueue (zone.js:474)
at XMLHttpRequest.ZoneTask.ZoneTask.cancelFn.invoke (zone.js:426)
zone.js:461 Unhandled Promise rejection: Failed to load %5Bobject%20Object%5D ; Zone: angular ; Task: Promise.then ; Value: Failed to load %5Bobject%20Object%5DconsoleError # zone.js:461_loop_1 # zone.js:490drainMicroTaskQueue #zone.js:494ZoneTask.ZoneTask.cancelFn.invoke # zone.js:426
Current project is available here

So for some reason this worked with the built in webpack server
styleUrls: [String(require('./navbar.component.styl'))]
This of course should be
styles: [String(require('./navbar.component.styl'))]

Related

(plugin node-resolve) Error: Error running plugin hook resolveId for node-resolve, expected a function hook

Following 14.0.0 version upgrade for "#rollup/plugin-node-resolve" plugin, when running my build I always get this error message :
[!] (plugin node-resolve) Error: Error running plugin hook resolveId for node-resolve, expected a function hook.
Error: Error running plugin hook resolveId for node-resolve, expected a function hook.
at error (/Users/***/Documents/GitHub/poke/node_modules/rollup/dist/shared/rollup.js:198:30)
at throwInvalidHookError (/Users/***/Documents/GitHub/poke/node_modules/rollup/dist/shared/rollup.js:22635:12)
at /Users/***/Documents/GitHub/poke/node_modules/rollup/dist/shared/rollup.js:22776:24
Was there any breaking change that I should be aware ?

Import fritzapi (node package) into Ionic project

I am currently trying to use this API in my Ionic project, but man, I have no clue on how to do it. I tried figuring it out using things like this, but I always get errors on ionic server:
101 unchanged chunks
[ng] chunk {home-home-module} home-home-module.js, home-home-module.js.map (home-home-module) 3.07 MB [rendered]
[ng]
[ng] ERROR in ./node_modules/request/lib/har.js
[ng] Module not found: Error: Can't resolve 'fs' in 'D:\Programmierung\Workspaces\Ionic\HomeAutomation\node_modules\request\lib'
[ng] ERROR in ./node_modules/forever-agent/index.js
[ng] Module not found: Error: Can't resolve 'net' in 'D:\Programmierung\Workspaces\Ionic\HomeAutomation\node_modules\forever-agent'
[ng] ERROR in ./node_modules/tough-cookie/lib/cookie.js
[ng] Module not found: Error: Can't resolve 'net' in 'D:\Programmierung\Workspaces\Ionic\HomeAutomation\node_modules\tough-cookie\lib'
[ng] ERROR in ./node_modules/tunnel-agent/index.js
[ng] Module not found: Error: Can't resolve 'net' in 'D:\Programmierung\Workspaces\Ionic\HomeAutomation\node_modules\tunnel-agent'
[ng] ERROR in ./node_modules/forever-agent/index.js
[ng] Module not found: Error: Can't resolve 'tls' in 'D:\Programmierung\Workspaces\Ionic\HomeAutomation\node_modules\forever-agent'
[ng] ERROR in ./node_modules/tunnel-agent/index.js
[ng] Module not found: Error: Can't resolve 'tls' in 'D:\Programmierung\Workspaces\Ionic\HomeAutomation\node_modules\tunnel-agent'
[ng] Time: 2321ms
[ng] i 「wdm」: Failed to compile.
I'm super new to webdev and Ionic in general, so I don't know if this is even possible, but I feel like it should be. Above error is a result of the following code:
import { Component } from '#angular/core';
import * as fritzapi from 'fritzapi';
#Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor() {
fritzapi.getSessionID("removedforstack", "removedforstack").then(function(sid) {
console.log(sid);
});
}
}
Thanks in advance to everyone who's trying to help <3
I suspect this isn't possible. I think that you are trying to use something that's expected to be run on the local network in a node environment.
I did a search and found this article:
https://www.amadousall.com/angular-cli-module-not-found-error-cant-resolve/
Which say they used to do this:
supply an empty module when fs, crypto, tls and net were requested.
Which doesn't make sense really out of context but I couldn't find a simple bit to quote, take a look at the article.
Ultimately the angular team says:
Browser code should not rely on things that are not available in browser environments.
I'm assuming that the library needs to use these things to connect to the local network and interact with your home automation.
If i'm wrong then the article does have a way to supply an empty file instead of those modules, so if the code has alternate modes then it could work, but it doesn't seem likely to me off the top of my head.

Angular 4 #ngx-translate Karma Jasmin test cases

Trying to integrate Angular 4 + #ngx-translate. Everything is executing and working properly with npm start. Problem arises when I tries to npm test run Karma test cases. All these started after adding #ngx-translate capabilities.
Console get below error:
20 09 2017 14:24:30.334:INFO [Chrome 60.0.3112 (Windows 7 0.0.0)]: Connected on socket n1uvSjMzMfCGU26zAAAA with id 7587189
Chrome 60.0.3112 (Windows 7 0.0.0) ERROR
Uncaught TypeError: Cannot read property 'Injectable' of undefined
at node_modules/#ngx-translate/core/bundles/core.umd.js:817
On browser console:
Uncaught TypeError: Cannot read property 'Injectable' of undefined
at Object.<anonymous> (core.umd.js:817)
at __webpack_require__ (core.umd.js:30)
at Object.module.exports (core.umd.js:1421)
at __webpack_require__ (core.umd.js:30)
at module.exports (core.umd.js:76)
at core.umd.js:79
at webpackUniversalModuleDefinition (core.umd.js:9)
at core.umd.js:10
ng-bootstrap.js:9 Uncaught TypeError: Cannot read property 'core' of undefined
at webpackUniversalModuleDefinition (ng-bootstrap.js:9)
at ng-bootstrap.js:10
On browser:
OtherComponent when inside a test host should process Instance name
TypeError: Cannot read property 'bpmWrapWorkItemList' of undefined
TypeError: Cannot read property 'bpmWrapWorkItemList' of undefined
Please help !!! I am new to Angular 4..
Please put beforeEach block to update language for translateservice
beforeEach(inject([TranslateService], (service: TranslateService) => {
service.use('de');
}));
I had a similar issue, and was able to resolve the problem by removing two script definitions in .angular-cli.json.
I replaced
"scripts": [
"../node_modules/#ngx-translate/core/bundles/core.umd.js",
"../node_modules/#ngx-translate/http-loader/bundles/http-loader.umd.js"
],
with
"scripts": [],
While this resolves the problem, and the translate service still works, I do not know why those scripts are required in the first place, and if it's okay to remove them.

Cant start Spinnaker UI Deck

Getting error in spinnaker when we start the web-ui.
Get stuck too much. The error i got is:
vendor.bundle.js:9331 Uncaught Error: [$injector:modulerr] Failed to instantiate module netflix.spinnaker due to:
Error: [$injector:modulerr] Failed to instantiate module spinnaker.core due to:
Error: [$injector:modulerr] Failed to instantiate module spinnaker.core.notification.types due to:
TypeError: Cannot read property 'email' of undefined at Object.register
thanks .
What spinnaker version do you run?
Upgrade spinnaker first
perhaps use Minnaker OSS to get started faster for PoC.

aurelia-dialog TypeError: _aureliaPal.DOM.injectStyles is not a function

I've simply installed the aurelia-dialog plugin, version 1.0.0-beta.1.1.0, and registered it with aurelia, but I'm getting an error:
aurelia.use
.plugin('aurelia-dialog');
dialog-configuration.js:65 Uncaught (in promise) TypeError: _aureliaPal.DOM.injectStyles is not a function(…)
_apply # dialog-configuration.js:65
configure # aurelia-dialog.js:73
(anonymous function) # aurelia-framework.js:272
I just experienced the same problem - solved it by running "jspm update", which caused several aurelia packages to be updated from beta-1.2.1 or beta-1.2.2 to rc-1.0.0 and added various other packages. Hence, the problem seems to be caused by some kind of version conflict.