-
Notifications
You must be signed in to change notification settings - Fork 74
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 CLI build breaks when importing aurelia-auth #144
Comments
I was able to make it build by using the path
Is this basically the correct way to handle new dependencies? |
I think you can just add their names.
Let me know if that works for you. |
khuongduybui, it doesn't work. You must add aurelia-auth path manual to aurelia.json file (see post above). I think that problem in aurelia-auth config file or something else. If you go to "aurelia-http-client/config.js" then you can find different line in path: But in "aurelia-auth/config.js" that line like that: |
Maybe related to this? |
Try this in your aurelia.json bundles dependencies. It should work.
|
Tried with both:
and
and it builds the app with
I also tried the solution proposed in: aurelia/cli#212 but I receive the same error! |
Not sure what your problem is but I got a working "dependencies": [
...
"aurelia-fetch-client",
"aurelia-http-client",
{
"name": "aurelia-auth",
"path": "../node_modules/aurelia-auth/dist/amd",
"main": "aurelia-auth"
}, Perhaps take a look at my Github Project - Realtime-TODO-Aurelia-Auth-RethinkDB to get you going. However please note that I replaced all the |
@ghiscoding on a totally different note, RethinkDB went out of business. |
@khuongduybui I know but RethinkDB is still an Open Source Project that will live on (even if the maintenance went down drastically), the company might be dead but the project is not. However, I only posted a link to my project to help others. |
I am getting the same issue as you...
What's frustrating, is that if I download the project from here: https://github.com/chenkie/aurelia-jwt-auth/tree/master/client and au build, it works. I have been comparing aurelia.json files, I have been trying to find how or what's missing from one to the other and I can't figure it out... Any help is appreciated. |
@evak2979 There's couple things that might be worth checking. Does your "paths": {
"root": "src",
"resources": "src/resources",
"elements": "src/resources/elements",
"attributes": "src/resources/attributes",
"valueConverters": "src/resources/value-converters",
"bindingBehaviors": "src/resources/binding-behaviors"
},
...
"aurelia-fetch-client",
"aurelia-http-client",
{
"name": "aurelia-auth",
"path": "../node_modules/aurelia-auth/dist/amd",
"main": "aurelia-auth"
}, Then in your import authConfig from './authConfig';
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.feature('resources')
.plugin('aurelia-auth', (baseConfig)=> {
baseConfig.configure(authConfig);
}); and make sure to add it in your export function configure(config) {
config.globalResources([
'./elements/loading-indicator',
'./value-converters/authenticatedFilter' // <-- HERE
]);
}
export class AuthenticatedFilterValueConverter {
toView(routes, isAuthenticated) {
if(!routes) return;
return routes.filter(r => r.config.auth === undefined || r.config.auth === isAuthenticated);
}
} I think that I've seen that problem with the |
Thank you for your quick response ! I did go through your code, but there were things I did not understand. In particular:
According to naming convention, this should be used as authenticatedFilter if we are using it as a valueconverter, but we're not... it's only authFilter that it's used. I even did a search for authFilter in both our projects. We have the exact same entries in app and vendor bundle, and it's only used in the nav-bar html. -- Edit |
@evak2979 I thought that I copied I'm also a starter on EDIT |
I'm having troubles using
aurelia-auth
in a simple test project.What I've done so far:
au new
with the following options: Custom, Babel, SASS, No unit testing, WebStormau run --watch
is working just fine as expectedaurelia-auth
usingnpm install aurelia-auth --save
import {AuthService} from 'aurelia-auth';
to the top ofapp.js
The running
au run
crashes after savingapp.js
with the following error (besides others):Obviously it can't map the imported
aurelia-auth
correctly to the respective node package but tries to load it from the project sources.Therefore I've added the dependency myself to
vendor-bundle.js
in thebundles
section ofaurelia.json
:Now I'm getting different errors:
I'd really appreciate any help with that!
The text was updated successfully, but these errors were encountered: