Skip to content

[Bug]: module.resolveFully cannot work with remote execution #347

@Olsworn

Description

@Olsworn

What happened?

Running the swc transpiler through ts_project with module.resolveFully set to true in .swcrc leads to different outputs when remote execution is enabled than when running locally.

This is due to only passing the file to transpile as input to the swc_action, and not the other source files / transpiled files from dependencies.

Version

bazel: 9.0.0
aspect_rules_ts: 3.8.6
aspect_rules_swc: 2.6.2
Os: Linux x86_64

How to reproduce

Have a `.ts` file import a file from a directory with an index file, set resolveFully to true in .swcrc.

main.ts:

import { something } from "./folder";
console.log(something);


folder/index.ts:

const something: string = "something";
export { something };


Without remote execution:
main.js:

import { something } from "./folder/index.js";
console.log(something);


With remote execution:
main.js:

import { something } from "./folder";
console.log(something);

Any other information?

This case is a bit tricky to handle, as a fix might impact performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions