jbreckmckye / electron-auth0-login

Helper widget for Auth0 authentication in Electron desktop apps
MIT License
28 stars 19 forks source link

Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined #15

Closed samuelkampf closed 4 years ago

samuelkampf commented 4 years ago

type error with version 1.3.0 Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined

jbreckmckye commented 4 years ago

Hmm. Could you post a stacktrace? I'm curious where this could be coming from. Or is this happening during build?

samuelkampf commented 4 years ago

it may be because im using angular its not possible to import this into a component is it?

danteata commented 4 years ago

I get the same error as well.

Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:112)
    at dirname (path.js:1129)
    at Object.exports.findPackage (index.js:209)
    at Object.exports.register (index.js:295)
    at Object.eval (index.js:19)
    at eval (index.js:158)
    at Object../node_modules/electron-auth0-login/dist/index.js (renderer.dev.dll.js:12965)
    at __webpack_require__ (renderer.dev.dll.js:21)
    at Object../node_modules/electron-auth0-login/dist/index.js (index.js from dll-reference renderer:1)
    at __webpack_require__ (bootstrap:726)
NodeError @ internal/errors.js:216
validateString @ internal/validators.js:112
dirname @ path.js:1129
exports.findPackage @ index.js:209
exports.register @ index.js:295
eval @ index.js:19
eval @ index.js:158
./node_modules/electron-auth0-login/dist/index.js @ renderer.dev.dll.js:12965
__webpack_require__ @ renderer.dev.dll.js:21
./node_modules/electron-auth0-login/dist/index.js @ index.js from dll-reference renderer:1
__webpack_require__ @ bootstrap:726
fn @ bootstrap:100
(anonymous) @ Routes.js:3
./app/Routes.js @ renderer.dev.js:960
__webpack_require__ @ bootstrap:726
fn @ bootstrap:100
(anonymous) @ Root.js:5
./app/containers/Root.js @ renderer.dev.js:12569
__webpack_require__ @ bootstrap:726
fn @ bootstrap:100
(anonymous) @ index.js:4
./app/index.js @ renderer.dev.js:12663
__webpack_require__ @ bootstrap:726
fn @ bootstrap:100
0 @ only-dev-server.js:102
__webpack_require__ @ bootstrap:726
(anonymous) @ bootstrap:793
(anonymous) @ bootstrap:793
jbreckmckye commented 4 years ago

@danteata Do you get the same issue with v1.1.0? I'm wondering whether this is a problem with the latest build

samuelkampf commented 4 years ago

The problem only occurs if you use it inside an app if you import and use it in main it works but anywhere else it errors

On Mon, Feb 10, 2020 at 6:11 AM Jimmy Breck-McKye notifications@github.com wrote:

@danteata https://github.com/danteata Do you get the same issue with v1.1.0? I'm wondering whether this is a problem with the latest build

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jbreckmckye/electron-auth0-login/issues/15?email_source=notifications&email_token=AIPJNQV5OI5RXNFOG4VVAFTRCEY6LA5CNFSM4KSDH4T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELIDZFA#issuecomment-584072340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPJNQWUND5K6TCD42OHTRLRCEY6LANCNFSM4KSDH4TQ .

jbreckmckye commented 4 years ago

Ah. Thanks for that insight @samuelkampf. Yeah, there is a line about this in the readme, but it's a bit hidden -

In a module available to your main process code (e.g. auth.ts): {setup code }

I will try and make this a bit clearer.

samuelkampf commented 4 years ago

yeah thats the only downfall about it there is no way to call it inside of angular. I ended up switching over to firebase which imo is much better than auth0's aio solution

On Tue, Feb 11, 2020 at 6:26 AM Jimmy Breck-McKye notifications@github.com wrote:

Ah. Thanks for that insight @samuelkampf https://github.com/samuelkampf. Yeah, there is a line about this in the readme, but it's a bit hidden -

In a module available to your main process code (e.g. auth.ts): {setup code }

I will try and make this a bit clearer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jbreckmckye/electron-auth0-login/issues/15?email_source=notifications&email_token=AIPJNQSDSVN6VC2AVSUO52LRCKDPPA5CNFSM4KSDH4T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELMCMOQ#issuecomment-584590906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPJNQX5TC5MFSRE7BUTN4TRCKDPPANCNFSM4KSDH4TQ .

samuelkampf commented 4 years ago

one work around is to serve your entire electron app from express then u can call from localhost using auth0 lock etc

On Tue, Feb 11, 2020 at 9:43 AM Samuel Kampf samuelkampf@gmail.com wrote:

yeah thats the only downfall about it there is no way to call it inside of angular. I ended up switching over to firebase which imo is much better than auth0's aio solution

On Tue, Feb 11, 2020 at 6:26 AM Jimmy Breck-McKye < notifications@github.com> wrote:

Ah. Thanks for that insight @samuelkampf https://github.com/samuelkampf. Yeah, there is a line about this in the readme, but it's a bit hidden -

In a module available to your main process code (e.g. auth.ts): {setup code }

I will try and make this a bit clearer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jbreckmckye/electron-auth0-login/issues/15?email_source=notifications&email_token=AIPJNQSDSVN6VC2AVSUO52LRCKDPPA5CNFSM4KSDH4T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELMCMOQ#issuecomment-584590906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPJNQX5TC5MFSRE7BUTN4TRCKDPPANCNFSM4KSDH4TQ .

danteata commented 4 years ago

Thanks for clarifying @jbreckmckye. Using in the main process code worked.

jbreckmckye commented 4 years ago

I've updated the docs to make this a bit more obvious.