scaleflex/next-cloudimage-responsive

Getting "TypeError: Cannot read properties of undefined (reading 'indexOf')"

Closed this issue · 2 comments

I have installed the module and am trying to integrate it into my project. Unfortunately, as soon as I wrap my components in the CloudimageProvider, I get an error.

screenshot

I have removed the "Component" component for testing purposes, but still get the error:

import CloudimageProvider from 'next-cloudimage-responsive'

export default function App({ Component, pageProps }) {
    const cloudimageConfig = {
        token: process.env.cloudimageToken,
        baseURL: process.env.cloudimageUrl,
    };
    
    return (
        <CloudimageProvider config={cloudimageConfig}>
        </CloudimageProvider>
    )
}

I'm usind Next.js Version 13.4.5

Fixed! Your readme on GitHub ist wrong:

import CloudimageProvider from ' next-cloudimage-responsive';

It has do be:

import { CloudimageProvider } from "next-cloudimage-responsive";

thanks, @PSMJonas for debugging the issue, The docs have been updated!