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

tsx breaks importing paths that include query params #264

Closed
1 task
iambumblehead opened this issue Jul 11, 2023 · 4 comments · Fixed by esbuild-kit/esm-loader#76
Closed
1 task

tsx breaks importing paths that include query params #264

iambumblehead opened this issue Jul 11, 2023 · 4 comments · Fixed by esbuild-kit/esm-loader#76
Labels
bug Something isn't working outdated resolver

Comments

@iambumblehead
Copy link

Bug description

The following test fails when tsx is used as the loader

import test from 'ava'
import assert from 'assert'

test('tsx should not break when import paths include query params', async () => {
  assert.ok(await import('../local/main.ts?query=params'))
})

actual result: The test fails

  TypeError {
    code: 'ERR_UNKNOWN_FILE_EXTENSION',
    message: 'Unknown file extension ".ts" for /home/bumble/tsx-demo/tests/local/main.ts',

expected result: The test should not fail.

Reproduction

import test from 'node:test'
import assert from 'assert'

test('tsx should not break when import paths include query params', async () => {
  assert.ok(await import('../local/main.ts?query=params'))
})

Environment

System:
    OS: Linux 6.3 Arch Linux
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 18.43 GB / 31.07 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.4.0 - /usr/bin/node
    npm: 9.8.0 - /usr/bin/npm
  npmPackages:
    tsx: ^3.12.7 => 3.12.7

Can you work on a fix?

  • I’m interested in opening a pull request to address this issue.
@qodesmith
Copy link

@iambumblehead I've never seen query params on a file location. Is that valid? What's that used for?

@iambumblehead

This comment was marked as off-topic.

@iambumblehead

This comment was marked as off-topic.

@privatenumber
Copy link
Owner

@qodesmith

To determine if it's valid, simply check if it works on Node.js or TypeScript.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 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 resolver
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants