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

IKImage raises ReferenceError: regeneratorRuntime is not defined in Next JS with typescript project #144

Closed
lorenzocestaro opened this issue Feb 1, 2024 · 5 comments

Comments

@lorenzocestaro
Copy link

Hello, I am trying to use IKImage in a Next JS project (with typescript). The compilation fails with a ReferenceError: regeneratorRuntime is not defined.

I am not sure what is causing it, but it seems all the bundles in dist are using regeneratorRuntime.

I found this similar issue that I think it could be a starting point to fix this, but I am not 100% sure

@lorenzocestaro lorenzocestaro changed the title IKImage raises ReferenceError: regeneratorRuntime is not defined in Next JS with typescript project IKImage raises ReferenceError: regeneratorRuntime is not defined in Next JS with typescript project Feb 1, 2024
@karthik-js
Copy link

Same issue with React (Vite) project

@rcastellanos1937
Copy link

Same issue ReferenceError: regeneratorRuntime is not defined has anyone figure it out yet?

@ankur-dwivedi
Copy link
Collaborator

ankur-dwivedi commented Feb 21, 2024

Hi @lorenzocestaro i have tested with imagekitio-react@4.0.0, next@14.1.0 with typescript, react@18 using below snippet

<IKImage
    path="default-image.jpg"
    urlEndpoint={urlEndpoint}
    transformation={[
       {
           height: "300",
           width: "200",
           cropMode: "extract",
           raw: "l-text,i-Imagekit,fs-20,l-end",
        },
    ]}
/>

It's working well on my end. Can you provide more details about your configurations and code so I can reproduce the issue?

@rcastellanos1937
Copy link

Hello after talking to support, was not a problem of the package, all that needs to be added is this runtime, create a runtime.js and add it to your project.

runtime.txt

@lorenzocestaro
Copy link
Author

I solved this by adding import "regenerator-runtime/runtime"; in my project's _app.tsx file.

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