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

Support import assertions on import declarations in the REPL #13115

Closed
dsherret opened this issue Dec 16, 2021 · 0 comments · Fixed by #13121
Closed

Support import assertions on import declarations in the REPL #13115

dsherret opened this issue Dec 16, 2021 · 0 comments · Fixed by #13121
Assignees
Labels
bug Something isn't working correctly cli related to cli/ dir repl related to the Read-Eval-Print-Loop functionality of Deno

Comments

@dsherret
Copy link
Member

dsherret commented Dec 16, 2021

Just need to transform it correctly:

> import data from "./test.json" assert { type: "json" };
Uncaught TypeError: Expected a "JavaScript" module but loaded a "JSON" module.
    at async <anonymous>:2:28

Also, maybe ensure that for export declarations it just doesn't error.

Workaround:

const data = (await import("./test.json", { assert: { type: "json" } })).default;
@dsherret dsherret added cli related to cli/ dir repl related to the Read-Eval-Print-Loop functionality of Deno labels Dec 16, 2021
@dsherret dsherret self-assigned this Dec 16, 2021
@dsherret dsherret changed the title Support import assertions in the REPL Support import assertions on import declarations in the REPL Dec 16, 2021
@dsherret dsherret added the bug Something isn't working correctly label Dec 16, 2021
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 cli related to cli/ dir repl related to the Read-Eval-Print-Loop functionality of Deno
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant