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

Fixes typescript build failure comparing null | undefined #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toddheslin
Copy link

@mhamas I came across an issue deploying this today, so I've made a patch for you.

The key issue is that in node_modules/apify/types/proxy_configuration.d.ts, we have:

export function createProxyConfiguration(proxyConfigurationOptions?: ProxyConfigurationOptions | undefined): Promise<ProxyConfiguration | null>;

Meaning proxyConfigurationObject is maybe null:

image

But in node_modules/apify/types/crawlers/puppeteer_crawler.d.ts, we have:

proxyConfiguration?: any;

Which means it could be set or undefined, but not null:

image

The nullish-colleasing patch means if it's null, we make it undefined to keep TS happy.

Turning:
image

into:
image

Copy link
Owner

@mhamas mhamas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, many thanks.

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

Successfully merging this pull request may close these issues.

2 participants