aurelia / loader-webpack

An implementation of Aurelia's loader interface to enable webpack.
MIT License
26 stars 10 forks source link

modules[moduleId].call breaks aurelia-testing #19

Closed niieani closed 7 years ago

niieani commented 7 years ago

https://github.com/aurelia/testing/issues/21

spencewood commented 7 years ago

I hate to bring this up again, but as I mentioned in the above ticket three weeks ago, this issue is blocking me from updating to the ^1.0.0 release of Aurelia with webpack.

Is there is an update, quick fix or workaround for this issue, I would be very appreciative.

niieani commented 7 years ago

You could try using the older, loader-webpack@1.0.0 instead of 1.0.3. It might work, but might also introduce other bugs. Otherwise, the fix should land sometime in November.

stevies commented 7 years ago

This problem appears to affect ES6 code also - not just TS. See:

https://github.com/aurelia/testing/issues/40

Effectively blocking all testing of viewmodels, custom elements, etc.

niieani commented 7 years ago

Yes, it's not written anywhere that it's TS specific. It's not related to the language.

rokadias commented 7 years ago

I might be having the same issue. WebpackLoader.loadModule fails with Unhandled rejection Error: Loading chunk 0 failed.

Snippets of relevant code looks like:

import {configure} from '../shared/validation';
import {$beforeEach} from 'async-await-jasmine';
import {bootstrap} from 'aurelia-bootstrapper-webpack';
import {ComponentTester, StageComponent} from 'aurelia-testing';

  $beforeEach(async () => {
    component = StageComponent
      .withResources('subjects/add-new-subject')
      .inView('<add-new-subject></add-new-subject>')
      .boundTo({});
    component.bootstrap(configure);
    await component.create(<any> bootstrap);
});
import {Aurelia} from 'aurelia-framework';
import {DOM} from 'aurelia-pal';

export function configure(aurelia: Aurelia) {
  'use strict';

  aurelia.use
    .standardConfiguration()
    .plugin('aurelia-validation');
}
smax48 commented 7 years ago

We have a very large BI application that is being written using Aurelia. This issue is effectively blocking all unit testing for UI components.

niieani commented 7 years ago

I will be tackling this in the next week or two.

stevies commented 7 years ago

Any update on this? Sorry to hassle you.

niieani commented 7 years ago

@stevies It's almost ready, but something got in the way of me finishing it. Give it a few more days.

stevies commented 7 years ago

Does your work on the new experimental skeleton mean that you now have no plans to fix this defect?

niieani commented 7 years ago

@stevies the new Webpack plugins which are used by the nee skeleton is the fix for this defect. Aurelia Webpack Plugin, which is the culprit here, will be deprecated, but migration to the new set of Webpack plugins will be straight forward and very easy. For those using easy-webpack I'll simply create a major version bump on @easy-webpack/config-aurelia which contains all the changes.

stevies commented 7 years ago

Cool. I'll wait on the new stuff being released.

stevies commented 7 years ago

Any updates? I'm probably going to have to look at switching to using something other than Webpack in the short to medium term. Last time I looked at the CLI for building it was horrible to use, but I might have to live with that since not being able to test anything is a real problem.

nashwaan commented 7 years ago

Its 2017, any update on this?

niieani commented 7 years ago

Hey guys, I'm sorry I couldn't meet the deadline I've set for myself. The remaining workload isn't overwhelming, but I'm struggling to find time to work on it since December. We might be getting a new team member soon, so hopefully, if not by me, this should be resolved relatively soon.

sludemann commented 7 years ago

Bump.

niieani commented 7 years ago

New release coming up in few days (~ 5 - 15). https://github.com/aurelia/skeleton-navigation/issues/714.

lukefx commented 7 years ago

New release coming up in few days (~ 5 - 15).

Sorry to bother you about it @niieani but, any news about that?

niieani commented 7 years ago

Sorry @lukefx, been working on it, on and off, as I've been busy and now I'm a bit ill too, which doesn't help.

marktaling commented 7 years ago

Came across the issue here as well. Is there any way we can help to speed along the fix? (Currently using the @easy-webpack from the skeletons)

fnzr commented 7 years ago

Same issue here. Just pinging.

niieani commented 7 years ago

Fixed by https://github.com/aurelia/skeleton-navigation/pull/714

nashwaan commented 7 years ago

I still get errors with the new skeleton for tests that uses StageComponent in the browser.

Can someone else confirms whether StageComponent tests compiled by webpack and run in the browser (not jest) are working ok or not?

waywardz commented 7 years ago

@nashwaan They are not working for me.

nashwaan commented 7 years ago

@niieani Can you reopen this issue?

waywardz commented 7 years ago

https://github.com/aurelia/testing/issues/21 is also similar, and currently open, though not labeled as a bug.

nashwaan commented 7 years ago

I just like to confirm the updated skeleton has solved the issue related to asynchronous StageComponent.

Thanks for your efforts @niieani . 😊