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

EDITOR: Cannot resolve import paths in some cases #1747

Open
catloversg opened this issue Nov 2, 2024 · 1 comment
Open

EDITOR: Cannot resolve import paths in some cases #1747

catloversg opened this issue Nov 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@catloversg
Copy link
Contributor

TypeScript support will be available on the stable version via #1216. In some cases, monaco cannot resolve the import paths. This is just a problem with the script editor UI. It does not affect anything else. It may be fixed by #1477, but I don't think that fix can be merged easily.

MRE:
lib.ts

export const multiply = (a: number, b: number) => a * b;

test.js

import { multiply } from "/lib";

export async function main(ns: NS) {
  ns.print(`multiply: ${multiply(2, 3)}`);
}

Screenshot:
Capture

With this case (use an absolute path), the player can work around by using a relative path (./lib instead of /lib).

I'll use this issue to keep track of the problem and potential fixes. Other reports can be marked "duplicate" and linked back to here.

@d0sboots
Copy link
Collaborator

d0sboots commented Nov 4, 2024

Yes, we should assume #1477 is dead in the water and steal pieces from it that are useful or mergeable.

@gmcew gmcew added the enhancement New feature or request label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants