Jackie
Jackie

Reputation: 23487

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

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

Upvotes: 0

Views: 1111

Answers (1)

Jackie
Jackie

Reputation: 23487

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'))]

Upvotes: 2

Related Questions