Hello, I'm trying to use ESM style relative file imports with query parameters in my code. I've read through the Modules Reference which suggests "The TypeScript compiler recognizes standard ECMAScript module syntax in TypeScript" and I didn't find any explicit mention of query parameters in imports not being supported. But I haven't been able to find a set of configuration options that seem to make it work.
For example my code looks like:
// @filename: dep.ts
export const f = () => {console.log("hi")};
// @filename: entry.ts
import { f } from "./dep.js?query=value";
f();
I'm using target: ESNext, module/moduleResolution: NodeNext. Attempting to compile errors with: entry.ts:1:19 - error TS2307: Cannot find module './dep.js?query=what' or its corresponding type declarations.. Renaming the files to .js and running directly with node does succeed. It seems like Typescript isn't fully modeling node's resolution in this situation. Is that expected?
Module syntax and compiler options reference