Skip to content

Replace const enum with enum to fix compatibility with isolatedModules #3125

@monolithed

Description

@monolithed

Which package is the feature request for? If unsure which one to select, leave blank

@crawlee/browser-pool

Feature

In the current version of @crawlee/browser-pool, OperatingSystemsName, DeviceCategory , and potentially other enums are declared as export const enum. This causes a TypeScript error when compiling projects with isolatedModules: true enabled:

TS2748: Cannot access ambient const enums when isolatedModules is enabled.

export const enum OperatingSystemsName {

export const enum DeviceCategory {

Motivation

Image

Ideal solution or implementation, and any additional constraints

Replacing const enum with enum will help downstream consumers avoid build errors and improve compatibility with Babel and other transpilers that do not support const enum in isolated mode.

Alternative solutions or implementations

No response

Other context

No response

Metadata

Metadata

Assignees

Labels

featureIssues that represent new features or improvements to existing features.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions