Yes, similar issue here. I found the solution:
Add a dependency in the Dependencies on the left side and make it an earlier version e.g.:
openai@14.4.2.
With the demo apikey as well, users most likely will not have access to gpt-4 or beyond gpt-4-turbo etc.
Therefore if model: ‘gpt-4’ throws an error, try the below and you can continue as per the lessons.
const response = await openai.chat.completions.create({
model: ‘gpt-3.5-turbo’,
messages: messages
})
It’s a fast moving development, hence, I can understand why what worked yesterday, will have some more explanation needed today.
Not sure if any update needs to be done in the backend to make the Scrimba UI compatible with the latest versions, however, please find the recommendation I have given for anyone coming across this issue. Maybe good to clarify in the course as well.
The way to do it:
-
Next to dependencies there is … click on it.
-
Then press “add modules”
-
Enter “openai@4.14.2” in the input box and press add
-
You should see the below:

- Run your query again.
Alternatively, the queries can be copied over to an IDE to replicate (what I tried to do first).
However, the above should work and should keep you in the Scrimba experience like it does for me.