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

Bolt fails to import finnhub service #6637

Open
1 task done
sarahandsilas opened this issue Feb 20, 2025 · 0 comments
Open
1 task done

Bolt fails to import finnhub service #6637

sarahandsilas opened this issue Feb 20, 2025 · 0 comments

Comments

@sarahandsilas
Copy link

Describe the bug

I asked Bolt to use the finnhub service to read stock data (instead of a hardcoded mock).
https://www.npmjs.com/package/finnhub?activeTab=readme

It appears to import the service, but the subsequent chat fails in a loop with:
TypeError: Cannot read properties of undefined (reading 'ApiClient')

When I log the finnhub object to the console, it appears to be blank.

import finnhub from 'finnhub';
alert(JSON.stringify(finnhub));

const api_key = finnhub.ApiClient.instance.authentications['api_key'];
api_key.apiKey = "<api key>";
const finnhubClient = new finnhub.DefaultApi()

Clicking "attempt fix" just generates variations on the same error.

Link to the Bolt URL that caused the error

https://bolt.new/~/sb1-jhtgcacd

Validations

  • Please make your project public or accessible by URL. This will allow anyone trying to help you to easily reproduce the issue and provide assistance.

Steps to reproduce

  1. Load the page
  2. Note error: TypeError: Cannot read properties of undefined (reading 'ApiClient')
  3. Click "Attempt Fix"
  4. Takes you back to step fix: add issue templates #2.

Expected behavior

Clicking "Attempt Fix" should correctly import and use the API.

Screen Recording / Screenshot

Image

Platform

Browser name = Chrome
Full version = 130.0.0.0
Major version = 130
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 87299961,
  "usedJSHeapSize": 85096813,
  "jsHeapSizeLimit": 4294705152
}
Username = sarahandsilas
Chat ID = 6ce8bddb8584
Client version = 6c0f11b
Server version = 6c0f11b

Additional context

No response

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

1 participant