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

deno compile/eszip does not follow redirects #13704

Closed
mweichert opened this issue Feb 17, 2022 · 4 comments · Fixed by #14161
Closed

deno compile/eszip does not follow redirects #13704

mweichert opened this issue Feb 17, 2022 · 4 comments · Fixed by #14161
Assignees
Labels
bug Something isn't working correctly compile related to the `deno compile` feature

Comments

@mweichert
Copy link

Since v1.19.0 was released, we're seeing a problem when running deno compile in Github Actions.

See: https://github.com/ecadlabs/taqueria/runs/5234787765?check_suite_focus=true

We were using:

- name: Setup Deno
        uses: denoland/setup-deno@v1
        with:
          deno-version: "^1.0.0"

When I hardcode the version to 1.18.2 everything works fine:

https://github.com/ecadlabs/taqueria/runs/5236615612?check_suite_focus=true

@littledivy littledivy added bug Something isn't working correctly compile related to the `deno compile` feature labels Feb 19, 2022
@littledivy
Copy link
Member

littledivy commented Feb 19, 2022

The issue is because of the implicit import to https://deno.land/x/i18next/index.js. Versioning your import should fix this.

divy@mini ~/g/taqueria (main)> ../deno/target/debug/deno compile ./index.ts 
Download https://deno.land/x/i18next/index.js
Warning Implicitly using latest version (v21.6.11) for https://deno.land/x/i18next/index.js
Download https://deno.land/x/i18next@v21.6.11/index.js
Download https://deno.land/x/i18next@v21.6.11/i18next.js
Download https://deno.land/x/i18next@v21.6.11/BackendConnector.js
Download https://deno.land/x/i18next@v21.6.11/EventEmitter.js
Download https://deno.land/x/i18next@v21.6.11/Formatter.js
Download https://deno.land/x/i18next@v21.6.11/Interpolator.js
Download https://deno.land/x/i18next@v21.6.11/LanguageUtils.js
Download https://deno.land/x/i18next@v21.6.11/PluralResolver.js
Download https://deno.land/x/i18next@v21.6.11/ResourceStore.js
Download https://deno.land/x/i18next@v21.6.11/Translator.js
Download https://deno.land/x/i18next@v21.6.11/defaults.js
Download https://deno.land/x/i18next@v21.6.11/logger.js
Download https://deno.land/x/i18next@v21.6.11/postProcessor.js
Download https://deno.land/x/i18next@v21.6.11/utils.js
Check file:///Users/divy/gh/taqueria/index.ts
Compile file:///Users/divy/gh/taqueria/index.ts
Emit taqueria
divy@mini ~/g/taqueria (main)> ./taqueria 
error: Module not found: https://deno.land/x/i18next/i18next.js

deno compile should follow the redirect to the versioned import.

@p-fruck
Copy link

p-fruck commented Feb 25, 2022

In my case deno also fails to import a script directly from GitHub using a raw link, regardless whether I specify the specify the branch name or the commit hash. Is this behavior intended?

@kitsonk kitsonk added duplicate a duplicate of another issue and removed bug Something isn't working correctly compile related to the `deno compile` feature labels Mar 15, 2022
@kitsonk kitsonk changed the title deno compile failing with 1.19.0 with denoland/setup-deno@v1 deno compile/eszip does not follow redirects Mar 15, 2022
@kitsonk kitsonk added bug Something isn't working correctly compile related to the `deno compile` feature and removed duplicate a duplicate of another issue labels Mar 15, 2022
@kitsonk
Copy link
Contributor

kitsonk commented Mar 15, 2022

There are other modules in the wild that are importing unversioned standard library modules which then redirect and then are not "compilable".

for example https://deno.land/x/yargs@v17.3.0-deno/deno.ts graph contains 3 redirects:

{
  "redirects": {
    "https://deno.land/std/fmt/printf.ts": "https://deno.land/std@0.129.0/fmt/printf.ts",
    "https://deno.land/std/path/mod.ts": "https://deno.land/std@0.129.0/path/mod.ts",
    "https://deno.land/std/testing/asserts.ts": "https://deno.land/std@0.129.0/testing/asserts.ts"
  }
}

We really should fix this.

@sjmueller
Copy link

Same problem here, we use the following command that fails with error: Module not found:

deno compile --unstable --import-map deps.json --lock deps-lock.json server.ts

We don't have any versions in deps.json:

{
  "imports": {
    "http": "https://deno.land/std/http/server.ts"
   }
}  

because we rely on our lock file to determine versioning in deps-lock.json:

{
  "https://deno.land/std@0.132.0/http/server.ts": "10c3a7814666cdbabd6f9c18acdcc4593e222275a628280a4868881445fbb5bc",
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly compile related to the `deno compile` feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants