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

Change from yerror.js to yerror.ts #2439

Open
victorfernandesraton opened this issue Oct 30, 2024 · 1 comment
Open

Change from yerror.js to yerror.ts #2439

victorfernandesraton opened this issue Oct 30, 2024 · 1 comment

Comments

@victorfernandesraton
Copy link

Issue

When try to compile yargs in deno 2.0 i received this error

error: Module not found "https://deno.land/x/[email protected]/build/lib/yerror.js".
    at https://deno.land/x/[email protected]/lib/platform-shims/deno.ts:18:22

i thin is a import error there, they try import js file but only ts file exists

import {YError} from '../../build/lib/yerror.js';

Steps to reproduce

  • Create a simple deno project with deno init
  • Put above code in main.ts file
  • Trying compile using deno compile -A main.ts
import yargs from "https://deno.land/x/[email protected]/deno.ts";
import type { Arguments } from "https://deno.land/x/[email protected]/deno-types.ts";

// Configura o yargs para capturar os argumentos da linha de comando
const argv = yargs(Deno.args)
    .option("portFacade", {
        alias: "pf",
        type: "number",
        description: "Porta da Facade",
        // demandOption: true,
    })
    .demandCommand(0)
    .strictOptions()
    .parseSync();

function main(args: Arguments) {
    console.log(args);
}

main(argv);

System information

OS: Win11 x64
Deno: deno 2.0.3 (stable, release, x86_64-pc-windows-msvc)
v8 12.9.202.13-rusty
typescript 5.6.2

@shadowspawn
Copy link
Member

Thanks for the clear description.

The problem is the tags being used for the deno versions of yargs have -deno on the end of the version number. Try adding that:

- import yargs from "https://deno.land/x/[email protected]/deno.ts";
+ import yargs from "https://deno.land/x/[email protected]/deno.ts";
- import type { Arguments } from "https://deno.land/x/[email protected]/deno-types.ts";
+ import type { Arguments } from "https://deno.land/x/[email protected]/deno-types.ts";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants