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

Import assertions are deprecated. Use with keyword, instead of 'assert' keyword. #10916

Closed
yurivict opened this issue Sep 29, 2024 · 10 comments
Closed
Labels
invalid This doesn't seem right

Comments

@yurivict
Copy link
Contributor

Bug description

quarto render prints this error:

$ quarto render computations.qmd --to pdf --output x.pdf
⚠  Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.

    const resourceModule = (await import(toFileUrl2(resourcePath("editor/tools/yaml/yaml-intelligence-resources.json")).href, {

  at file:///usr/local/share/quarto/bin/quarto.js:90004:119


Executing 'computations.quarto_ipynb'
  Cell 1/3: ''...Done
  Cell 2/3: ''...Done
  Cell 3/3: ''...Done

This error is fixed with this patch:

 async function initYamlIntelligenceResourcesFromFilesystem() {
     const resourceModule = (await import(toFileUrl2(resourcePath("editor/tools/yaml/yaml-intelligence-resources.json")).href, {
-        assert: {
+        with: {
             type: "json"
         }
     })).default;

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Your environment

Versions: 1.6.9 .. 1.6.15
deno-1.46.2
FreeBSD 14.1

Quarto check output

$ quarto check
Quarto 1.6.15
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.49.8: OK
      Deno version 1.46.2: OK
      Typst version 0.11.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.15
      Path: /usr/local/share/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/local/bin
      Version: undefined

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.10
      Path: /usr/local/bin/python3.11
      Jupyter: 5.7.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
@yurivict yurivict added the bug Something isn't working label Sep 29, 2024
@mcanouil
Copy link
Collaborator

Please do make sure you provide the means to reproduce.
An error message is unfortunately not enough.

Also, since Quarto from FreeBSD is not an official version/port of Quarto. Please do try on the officially supported system.

Additionally, ensure that the FreeBSD port is using validated version of the dependencies used by Quarto.

@mcanouil mcanouil added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Sep 29, 2024
@yurivict
Copy link
Contributor Author

@mcanouil

Deno-1.46.2 has this message hard-coded:

pub fn import_assertion_callback(
  args: deno_core::ImportAssertionsSupportCustomCallbackArgs,
) { 
  let mut msg = deno_terminal::colors::yellow("⚠  Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.").to_string();
  if let Some(specifier) = args.maybe_specifier {
    if let Some(source_line) = args.maybe_source_line {
      msg.push_str("\n\n");
      msg.push_str(&source_line);
      msg.push_str("\n\n");
    }

Apparently, the "assert:" syntax is deprecated in Deno-1.46.2 while Quarto is using it and Quarto also okays this deno version.
This looks like a bug in Quarto.

@mcanouil
Copy link
Collaborator

mcanouil commented Sep 29, 2024

No, Quarto does not use this version of Deno.
See https://github.com/quarto-dev/quarto-cli/blob/main/configuration

Again, please use and reproduce on officially supported system, preferably before opening bug reports. (This is valid for all your recent bug reports)
Quarto team is not responsible of the FreeBSD port.

@mcanouil
Copy link
Collaborator

mcanouil commented Sep 29, 2024

The Pandoc version reported is also wrong and is not even consistent with your other bug reports.

Clearly, your Quarto installation is corrupted either by you or by the port on FreeBSD.
Either way, in this context, the issue is very likely on your faulty environment.
This might also be why you have all the other issues.

@yurivict
Copy link
Contributor Author

yurivict commented Sep 29, 2024

The Pandoc version reported is also wrong and is not even consistent with your other bug reports.

quarto check okays it by printing this:

Pandoc version 3.2.0: OK


Quarto should provide a clean installation script that would install Quarto into a stage directory and it would check whether dependency versions are acceptable.

I wrote the suggestion here: #10923

@mcanouil
Copy link
Collaborator

Look at your other output from quarto check on your other issues.
Unless you are using different FreeBSD, I believe the output should be the same.
Here, depending on your issues, you don't have the proper dependencies setup.

@yurivict
Copy link
Contributor Author

@mcanouil

I updated pandoc between creating bug reports from the older 3.2 version to the 3.4 version that is also listed in the "configure" file for the latest Quarto.

@mcanouil
Copy link
Collaborator

mcanouil commented Sep 29, 2024

Please stop pinging/mentioning for no reason. I'm already following the thread, there is no reason to trigger notifications alert.

Still, you have an obviously unstable/corrupted installation.
You are not using the correct Deno version.
Very hard to tell what is the bug if there is one in such environment.

Even if I agree that it is unfortunate that FreeBSD (and others) are not officially supported, that is the current state. So, opening issues because Quarto does not work in FreeBSD (mostly because the environment is faulty) does not make things better. It unfortunately simply makes us go on a wild golden goose chase.

@cscheid
Copy link
Collaborator

cscheid commented Sep 30, 2024

@yurivict I'm going to ask to stop reporting issues on your own packages. Your behavior is now substantially disruptive to our ability to address other issues in the repository. You chose to package Quarto for FreeBSD: it's your responsibility to address the issues that your choice caused.

@cscheid cscheid closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
@cscheid cscheid added invalid This doesn't seem right and removed bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction labels Sep 30, 2024
@cscheid
Copy link
Collaborator

cscheid commented Sep 30, 2024

To make my decision clear: @yurivict I expect your future bug reports to come from a Linux distribution that we provide, and I will close ones that are filed using your own package. If you continue to do so, I will consider that a violation of our code of conduct and we will then act accordingly.

@mcanouil: FYI I'll take over managing issues from this reporter in the future. It's easier for your work that I engage with them directly instead of you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants