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

Can't add external librarry #424

Closed
2 tasks
vovikdrg opened this issue Jan 17, 2018 · 9 comments
Closed
2 tasks

Can't add external librarry #424

vovikdrg opened this issue Jan 17, 2018 · 9 comments
Assignees

Comments

@vovikdrg
Copy link

vovikdrg commented Jan 17, 2018

Stencil version:
-- @stencil/[email protected]

I'm submitting a:

Current behavior:
And i am getting an error

[ ERROR ] Error parsing: ...../dist/collection/components/my-app/my-app.js, line: 2, column: 9

[ ERROR ] rollup died at ......\node_modules@stencil\core\dist\compiler\index.js:1781:19 at
Generator.throw () at rejected
(.......\node_modules@stencil\core\dist\compiler\index.js:1748:65) at

Expected behavior:
I should be able to use external librarries

Steps to reproduce:
npm install oidc-client
then in component
import { UserManager, UserManagerSettings, User } from 'oidc-client';

componentDidLoad() {
     var config = {
      authority: "http://localhost:5000",
      client_id: "js",
      redirect_uri: "http://localhost:5003/callback.html",
      response_type: "id_token token",
      scope: "openid profile api1",
      post_logout_redirect_uri: "http://localhost:5003/index.html",
    };
    var mgr = new UserManager(config);
    mgr.getUser().then(function (user) {
      if (user) {
        console.log("User logged in", user.profile);
      }
      else {
        mgr.signinRedirect();
      }
    });
}

Related code:

// insert any relevant code here

Other information:

@jgw96
Copy link
Contributor

jgw96 commented Jan 17, 2018

Hello, thanks for opening an issue with us! Could you post a repo we could use to reproduce this issue? Also, for the team, linking this issue #162

@vovikdrg
Copy link
Author

@jgw96 hey, I've cloned your github PWA project and just installed oidc-client npm package
Then in my-app.tsx i've changed code

Added import

import { UserManager, UserManagerSettings, User } from 'oidc-client';

replaced componentDidLoad method

componentDidLoad() {
     var config = {
      authority: "http://localhost:5000",
      client_id: "js",
      redirect_uri: "http://localhost:5003/callback.html",
      response_type: "id_token token",
      scope: "openid profile api1",
      post_logout_redirect_uri: "http://localhost:5003/index.html",
    };
    var mgr = new UserManager(config);
    mgr.getUser().then(function (user) {
      if (user) {
        console.log("User logged in", user.profile);
      }
      else {
        mgr.signinRedirect();
      }
    });
}

If you still need repo then i will do.

@vovikdrg
Copy link
Author

Hey @jgw96 can you reproduce this one?

@jthoms1
Copy link
Contributor

jthoms1 commented Jan 23, 2018

I am working on some things in this space right now. Hopefully I will be able to test and reproduce tomorrow. Thanks!

@jgw96
Copy link
Contributor

jgw96 commented Jan 29, 2018

Note to self, test this today with the new code splitting implementation.

@jgw96 jgw96 self-assigned this Jan 29, 2018
@jgw96
Copy link
Contributor

jgw96 commented Feb 9, 2018

@jthoms1 update on this issue. I was able to get an app to build succesfully with this library by using this import import User from 'oidc-client'; but i then get this runtime error TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined . @vovikdrg have you seen this issue before with this library?

@vovikdrg
Copy link
Author

@jgw96 sorry for long response. I am able to use this vue.js and i dont have any issues.

@adamdbradley adamdbradley added this to the 0.7.0 - Dev Server milestone Feb 16, 2018
@jgw96 jgw96 added bug and removed needs info labels Feb 19, 2018
@jthoms1
Copy link
Contributor

jthoms1 commented Feb 21, 2018

I have the same results as @jgw96. I am able to get it imported but I receive a runtime error.

@jgw96
Copy link
Contributor

jgw96 commented Feb 21, 2018

Hello all! At this point, it looks like this is a runtime issue with that library and not specific to Stencil. Because of this, I am going to close this issue for now. Thanks for using Stencil!

@jgw96 jgw96 closed this as completed Feb 21, 2018
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

4 participants