Describe the bug
foo.json:
foo.js:
import foo from './foo.json' with { type: 'json' };
export { foo };
json-import.ts:
import { foo } from './foo.js';
console.log(foo.str);
tsconfig.json:
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "nodenext",
"resolveJsonModule": true
}
}
The plugin fails with x Expected ';', got 'with'
Reproduction
See above. Will push a PR with failing test
System Info
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
Memory: 7.19 GB / 31.89 GB
Binaries:
Node: 22.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - C:\ProgramData\npm\yarn.CMD
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
pnpm: 10.11.0 - C:\Program Files\nodejs\pnpm.CMD
Used Package Manager
npm
Validations
Describe the bug
foo.json:
{ "str": "bar" }foo.js:
json-import.ts:
tsconfig.json:
{ "compilerOptions": { "target": "ESNext", "module": "NodeNext", "moduleResolution": "nodenext", "resolveJsonModule": true } }The plugin fails with
x Expected ';', got 'with'Reproduction
See above. Will push a PR with failing test
System Info
System: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz Memory: 7.19 GB / 31.89 GB Binaries: Node: 22.15.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.22 - C:\ProgramData\npm\yarn.CMD npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD pnpm: 10.11.0 - C:\Program Files\nodejs\pnpm.CMDUsed Package Manager
npm
Validations