You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched existing issues before opening this one to avoid duplicates
I understand tsx aims for TypeScript parity and will not support arbitrary Node.js enhancements
This request cannot be made to Node.js directly, and is specific to tsx
I understand this form is not for addressing a bug or seeking help
Feature request
I tried to test some pieces of code copied from other source in the repl. But it seems does not support static import. I also tested with ts-node, it works for this scenario.
> tsx
Welcome to Node.js v20.11.0.
Type ".help" for more information.
> import {parse} from 'path';
import { parse } from "path";
^^^^^^
Uncaught:
SyntaxError: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import: const { parse } = await import("path");
>
> ts-node
> import {parse} from 'path'
undefined
> parse
[Function: parse]
>
I tested with non-repl environment, it works.
Motivations
For testing some code snippets without modification easier in the repl mode.
Precheck
Feature request
I tried to test some pieces of code copied from other source in the repl. But it seems does not support
static import
. I also tested withts-node
, it works for this scenario.I tested with non-repl environment, it works.
Motivations
For testing some code snippets without modification easier in the repl mode.
Alternatives
n.a.
Additional context
See also nodejs/node#48084 (comment).
No response
Contributions
The text was updated successfully, but these errors were encountered: