Skip to content

Remove dependency on path module for browsers #588

@pallymore

Description

@pallymore

Describe the bug

Currently when using the webworker runtime (from @aws/language-server-runtimes/runtimes/webworker) in the browser, consumers are required to provide the path node module, because the initializeUtils file depends on it. path is only available in NodeJS environments, in browsers, there is a polyfill path-browserify but it's been unmaintained for years.

Please remove the dependency on path for webworker runtimes - this was a regression as the same issue happened before but was later fixed.

This appears to be the problematic commit: fa9892e

Please also consider adding integration tests for browser environments to prevent non-browser modules being introduced accidentally.

To reproduce

  1. Start a web project
  2. Use the webworker runtime
  3. bundle the runtime for web (using a tool like webpack 5+)
  4. see dependency errors as path does not exist.

Expected behavior

The webworker module should work without using any NodeJS-only dependencies.

Your Environment

  • OS: Amazon Linux 2023

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions