Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aurelia-breeze, typescript (and webpack) #39

Open
apawsey opened this issue Aug 22, 2016 · 3 comments
Open

aurelia-breeze, typescript (and webpack) #39

apawsey opened this issue Aug 22, 2016 · 3 comments

Comments

@apawsey
Copy link

apawsey commented Aug 22, 2016

I have tried everything I can think of and cannot get aurelia-breeze, breeze and typescript to play together. I've tried re-editing the type definitions and all sorts... I just always end up with errors along the lines of...
node_modules/breeze-client/breeze.debug".export=' has no exported member 'EntityManager'.

Also my understanding is that I need to still use the webpack alias fix, but... if I do that I have to reference the import as breeze (instead of the real breeze-client), and then typescript can no longer find it...

Pulling my hair out here... any help greatly appreciated!

@Vaccano
Copy link

Vaccano commented Aug 22, 2016

I just got this working. (And it took a fair amount of my hair too!) I have been working on this for a while, so I am not sure exactly all that I did.

The two things I can remember are:

  1. Install the Typings from Definitely Typed using typings install dt~breeze --global
  2. Add this to my main.ts before the configure function:
    require('expose?breeze!breeze-client/breeze.debug');

You still need to have the normal .plugin('aurelia-breeze') as part of your aurelia.use.

@flieks
Copy link

flieks commented Sep 15, 2016

@apawsey did you get it to work?
I have problems after upgrading aurelia (from RC to 1.0.0).
But i think it's typescript 2.0 maybe. With TS 1.8 it worked fine.

@apawsey
Copy link
Author

apawsey commented Sep 29, 2016

Hey guys... sorry somehow missed the notifications for these replies!

No I didn't get it to work, until...
@Vaccano's require('expose?breeze!breeze-client/breeze.debug') tip...

It seems in my case that the typescript/babel/webpack combination (no idea whose responsible at this point) doesn't generate require statements in the end output for things imported via a namespace in typescript. I say this because with internal code I had exactly the same issue. So it seems that this expose tip is getting around it by simply making breeze a global variable, when it actually shouldn't really be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants