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 · 2 comments
Open

EDITOR: Cannot resolve import paths in some cases #1747

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

Comments

@catloversg
Copy link
Contributor

catloversg commented Nov 2, 2024

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.ts

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.

@lucebac
Copy link
Contributor

lucebac commented Dec 19, 2024

I've seen this error in the past as well when I updated the import resolution. However, I believe I wasn't able to fix this because from what I understand this is an edge case of the way we interact with and provide model data to monaco.

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

4 participants