Package Version: @tastytrade/api@6.0.0
Node Version: v22.12.0
Module System: ES Modules ("type": "module")
Problem
When importing TastytradeClient from @tastytrade/api v6.0.0, the application crashes with the following error:
SyntaxError: The requested module '@dxfeed/dxlink-api' does not provide an export named 'DXLinkFeed'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:180:21)
Root Cause
The issue is in lib/quote-streamer.ts line 1:
// CURRENT (BROKEN):
import { DXLinkWebSocketClient, DXLinkFeed, FeedContract, FeedDataFormat, type DXLinkFeedEventListener } from '@dxfeed/dxlink-api'
In @dxfeed/dxlink-api version 0.5.x, the DXLinkFeed export was moved from @dxfeed/dxlink-api to a separate package @dxfeed/dxlink-feed.
However, quote-streamer.ts still tries to import it from the old location, causing the error.
Impact
This error occurs even when not using the QuoteStreamer because:
TastytradeClient constructor instantiates QuoteStreamer (line 88 of tastytrade-api.ts)
- This loads
quote-streamer.ts
- Node.js evaluates all imports immediately
- The broken import fails before any code runs
This makes the entire @tastytrade/api@6.0.0 package unusable with current DXLink dependencies.
Reproduction Steps
npm install @tastytrade/api@6.0.0
import TastytradeClient from "@tastytrade/api";
const client = new TastytradeClient({
...TastytradeClient.ProdConfig,
clientSecret: 'your-client-secret',
refreshToken: 'your-refresh-token',
oauthScopes: ['read']
});
// 💥 Crashes before this line even executes
Proposed Fix
Split the import statement in lib/quote-streamer.ts:
// FIX:
import { DXLinkWebSocketClient, FeedContract, FeedDataFormat, type DXLinkFeedEventListener } from '@dxfeed/dxlink-api'
import { DXLinkFeed } from '@dxfeed/dxlink-feed'
Package Version:
@tastytrade/api@6.0.0Node Version:
v22.12.0Module System: ES Modules (
"type": "module")Problem
When importing
TastytradeClientfrom@tastytrade/apiv6.0.0, the application crashes with the following error:Root Cause
The issue is in
lib/quote-streamer.tsline 1:In
@dxfeed/dxlink-apiversion 0.5.x, theDXLinkFeedexport was moved from@dxfeed/dxlink-apito a separate package@dxfeed/dxlink-feed.However,
quote-streamer.tsstill tries to import it from the old location, causing the error.Impact
This error occurs even when not using the QuoteStreamer because:
TastytradeClientconstructor instantiatesQuoteStreamer(line 88 oftastytrade-api.ts)quote-streamer.tsThis makes the entire
@tastytrade/api@6.0.0package unusable with current DXLink dependencies.Reproduction Steps
Proposed Fix
Split the import statement in
lib/quote-streamer.ts: