aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Upgrading to 0.4.0 breaks import 'something.css!'; #120

Closed michaelmalonenz closed 8 years ago

michaelmalonenz commented 8 years ago

After upgrading to 0.4.0 (and a crucial step of deleting node_modules and then doing npm install) I can no longer bundle when the .js file includes css using the systemjs plugin-css.

I get this error:

[17:18:37] Error on fetch for github:drivesoftware/aurelia-widgets@0.4.10/styles.css!github:systemjs/plugin-css@0.1.21.js at file:///E:/work/radio/src/sales/Drive.Sales.UI/jspm_packages/github/drivesoftware/aurelia-widgets@0.4.10/styles.css!file:///E:/work/radio/src/sales/Drive.Sales.UI/jspm_packages/github/systemjs/plugin-css@0.1.21.js
        Loading main.js
        TypeError: loaderFetch.call(...).then is not a function
    at E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\lib\builder.js:180:8
    at SystemJSNodeLoader.<anonymous> (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\aurelia-bundler\dist\bundler.js:75:14)
    at SystemJSNodeLoader.loader.fetch (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\lib\builder.js:178:59)
    at E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\lib\trace.js:425:23
    at tryCatcher (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\promise.js:502:31)
    at Promise._settlePromise (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\promise.js:559:18)
    at Promise._settlePromise0 (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\promise.js:604:10)
    at Promise._settlePromises (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\promise.js:683:18)
    at Async._drainQueue (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\async.js:138:16)
    at Async._drainQueues (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (E:\work\radio\src\sales\Drive.Sales.UI\node_modules\systemjs-builder\node_modules\bluebird\js\release\async.js:17:14)
    at tryOnImmediate (timers.js:534:15)
    at processImmediate [as _immediateCallback] (timers.js:514:5)

This is using jspm v0.16.34 and plugin-text v0.1.21

dev0x10 commented 8 years ago

@michaelmalonenz I have the same problem. It's good you also have the problem 👍

My error:

Error on fetch for github:dogfalo/materialize@0.97.6/css/materialize.css!github:systemjs/plugin-css@0.1.21.js at file:///Users/name/Git/4leaflabs/ospoon-merchant/jspm_packages/github/dogfalo/materialize@0.97.6/css/materialize.css!file:///Users/name/Git/4leaflabs/ospoon-merchant/jspm_packages/github/systemjs/plugin-css@0.1.21.js

Error on fetch for github:drivesoftware/aurelia-widgets@0.4.10/styles.css!github:systemjs/plugin-css@0.1.21.js at file:///E:/work/radio/src/sales/Drive.Sales.UI/jspm_packages/github/drivesoftware/aurelia-widgets@0.4.10/styles.css!file:///E:/work/radio/src/sales/Drive.Sales.UI/jspm_packages/github/systemjs/# plugin-css@0.1.21.js

I'm curious about the last part 'plugin-css@0.1.21.js'. There is no such a file in plugin-css

paulocezar commented 8 years ago

Also had this problem, it seems related to systemjs-builder 0.15.17 and it isn't only 0.4.0 as I got it on 0.3.2. Manually installing systemjs-builder@=0.15.16 solved for me.

dev0x10 commented 8 years ago

@paulocezar ah nice! thanks man! I'll try later 🍻

alexisargyris commented 8 years ago

@paulocezar in that case the problem should be in systemjs/builder@61d7540. Any ideas?

michaelmalonenz commented 8 years ago

I have raised https://github.com/systemjs/builder/issues/600 and made a circular reference :)

dev0x10 commented 8 years ago

I can confirm that the solution from @paulocezar can fixing export problem

michaelmalonenz commented 8 years ago

The commit in SystemJS builder associated with the issue above fixes my problem, too.