AppExtensionsSDK is not a constructor

Hi :wave:

i’m currently trying the remix-cars-service App, but the app-extensions-sdk is causing problems. Everything works in the original version. After updating Remix to V.2+ and the app-extensions-sdk to 0.10.1, I get the following error message:

TypeError: AppExtensionsSDK is not a constructor

Code:

import React, { useState, createContext, useEffect } from 'react';
import PropTypes from 'prop-types';

import AppExtensionsSDK from '@pipedrive/app-extensions-sdk';

const SdkContext = createContext({ sdk: null });

const SdkContextProvider = ({ id, children }) => {
    const [sdk, setSdk] = useState(null);

    useEffect(() => {
            console.log("Creating new Sdk-Init! [id: %s]", id)
            const initialize = async () => {
				console.log(AppExtensionsSDK)
				const sdk = await new AppExtensionsSDK().initialize();

                setSdk(sdk);
            }

            initialize().catch(console.error);

    }, [id]);

    return (
        <SdkContext.Provider value={sdk}>
            {children}
        </SdkContext.Provider>
    );
};

SdkContextProvider.propTypes = {
    children: PropTypes.node.isRequired,
};

export { SdkContext, SdkContextProvider };

Does anyone know what I’m doing wrong?

Thanks in advance!

Hi @soeren,

I can confirm that after @pipedrive/app-extensions-sdk bump to 0.10.1 the app still works. There are broken styles, but SDK initialized without any issues (deployed on vercel).

I don’t have an opportunity at the moment to upgrade Remix deps and validate the app with them. What packages have you updated?

bro i got this error because we need to call sdk initialize method from a constructor().