Code Monkey home page Code Monkey logo

Comments (7)

asafshen avatar asafshen commented on June 25, 2024

@mertyildiran thanks for reporting!

In reference to our previous discussion regarding the recent issue,

I have not yet been able to reproduce this error. Could you please confirm whether this issue originates specifically from the Descope SDK code?

few questions:

  1. Do you have a way to run the application with a sourcemap, so we can see the exception call-stack with proper names/files?
  2. Does the error happen when the code is running both locally and served from a docker container?
  3. I have created a simple application that runs a simple react application with descope inside a docker container (fyi it is running against mine Descope project). can you see if that reproduce there when you run it? can you change the code/create a simple open source example where this reproduces?
    (instruction in the readme file, you can run the project locally or inside a docker iamge)

from react-sdk.

mertyildiran avatar mertyildiran commented on June 25, 2024

@mertyildiran thanks for reporting!

In reference to our previous discussion regarding the recent issue,

I have not yet been able to reproduce this error. Could you please confirm whether this issue originates specifically from the Descope SDK code?

few questions:

  1. Do you have a way to run the application with a sourcemap, so we can see the exception call-stack with proper names/files?
  2. Does the error happen when the code is running both locally and served from a docker container?
  3. I have created a simple application that runs a simple react application with descope inside a docker container (fyi it is running against mine Descope project). can you see if that reproduce there when you run it? can you change the code/create a simple open source example where this reproduces?
    (instruction in the readme file, you can run the project locally or inside a docker iamge)

I have opened the reproducing PR: asafshen/descope-react-in-docker#1

from react-sdk.

mertyildiran avatar mertyildiran commented on June 25, 2024

Looking at the unminified compiled JavaScript code:

import { __awaiter as t, __classPrivateFieldGet as e, __classPrivateFieldSet as i } from "tslib";
...
class Lt extends HTMLElement {
    constructor(o) {
        super(),
            B.add(this),
            G.set(this, !1),
            J.set(this, new F()),
            Q.set(this, new F()),
            (this.nextRequestStatus = new F({ isLoading: !1 })),
            X.set(this, void 0),
            Y.set(this, { popstate: e(this, B, "m", nt).bind(this) }),
            Z.set(this, void 0),
            lt.set(
                this,
                W(() =>
                    t(this, void 0, void 0, function* () {
                        const t = O(this.projectId, "config.json");
                        try {
                            const { body: e, headers: i } = yield E(t, "json");
                            return { projectConfig: e, executionContext: { geo: i["x-geo"] } };
                        } catch (t) {
                            this.logger.error("Cannot get config file", "make sure that your projectId & flowId are correct");
                        }
                        return {};
                    })
                )
            ),
            (this.logger = {
                error: (t, i = "") => {
                    console.error(t, i, new Error()), e(this, B, "m", vt).call(this, t, i);
                },
                info: (t, e = "") => {
                    console.log(t, e);
                },
            }),
            i(this, Z, o, "f"),
            e(this, B, "m", tt).call(this);
    }

Since the error is thrown while creating a new instance of Lt class and that class is actually BaseDescopeWc class, it should be a problem in the constructor method of BaseDescopeWc. The __classPrivateFieldGet (calls to e alias) suggests that there is a problem while trying to access a private property of class BaseDescopeWc. Therefore the error should be thrown in these lines.

from react-sdk.

mertyildiran avatar mertyildiran commented on June 25, 2024

Also see:

from react-sdk.

asafshen avatar asafshen commented on June 25, 2024

@mertyildiran, thank you for providing detailed information and for the reproduction PR. 🚀

I will proceed with checking it

from react-sdk.

asafshen avatar asafshen commented on June 25, 2024

@mertyildiran we have found the root cause of the issue

our internal packages are missing tslib dependency

We are working on a fix, but in the meantime, you can add the latest tslib as a dependency - and run the project again

npm install --save tslib

npm run start

I have added a PR to the sample repo to demonstrate the temporary solution

from react-sdk.

asafshen avatar asafshen commented on June 25, 2024

The issue is now fixed and avaialble in the latest next version (0.0.0-next-ad987b29-20230525)

an GA version will be avaialble soon

from react-sdk.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.