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

require causes a warning #80

Closed
1 task
segevfiner opened this issue Aug 11, 2022 · 0 comments · Fixed by #81
Closed
1 task

require causes a warning #80

segevfiner opened this issue Aug 11, 2022 · 0 comments · Fixed by #81
Labels
bug Something isn't working outdated

Comments

@segevfiner
Copy link

segevfiner commented Aug 11, 2022

Bug description

Try to import a plain CommonJS module using require from a tsx REPL.

Reproduction

index.js:

exports.foo = 123;
❯ tsx
Welcome to tsx v3.8.1 (Node.js v16.16.0).
Type ".help" for more information.
> const foo = require('.')
{
  detail: undefined,
  id: 'unsupported-require-call',
  location: {
    column: 12,
    file: 'REPL1.js',
    length: 7,
    line: 1,
    lineText: "const foo = require('.')",
    namespace: '',
    suggestion: ''
  },
  notes: [],
  pluginName: '',
  text: 'Converting "require" to "esm" is currently not supported'
}
undefined
> foo
{ foo: 123 }
>

Environment

  System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 117.00 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
    npm: 8.17.0 - ~/.nvm/versions/node/v16.16.0/bin/npm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.
@segevfiner segevfiner added bug Something isn't working pending triage labels Aug 11, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants