My typescript repl jut hangs for this input

Problem description:
My repl hangs when I simply try to execute the following in a typescript repl:

import { Configuration, OpenAIApi } from "openai";
const c = new Configuration()

It seems to be stuck on esbuild.

Expected behavior:
It doesnt hang.

Actual behavior:
It hangs. I have to kill esbuild in the console.

Steps to reproduce:
Typescript repl, paste this code, run

import { Configuration, OpenAIApi } from "openai";
const c = new Configuration()

Bug appears at this link:
https://replit.com/@leighst1/OpenaiPG2#index.ts

Browser/OS/Device:
mbp 2020?
chrome
osx monterey

Hey @leighst1!

Thank you for reporting this and for including all of the information. I was able to reproduce this and have sent this to the team. I will let you know as soon as I have an update!

2 Likes

We have found the cause of the issue to be the way esbuild handles bundling the openai package.

If you remove line 4 from the .replit file, that should fix the issue!

# .replit file

...

"--bundle",
# ^ remove that
1 Like

Awesome thanks! Looks like it works for new repls too.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.