[🐞] Support Typescript "moduleResolution": "node16" and "bundler"
Open
Nobody has claimed this yet.
bug
optimizer
- Dominant language
- TypeScript
- Stars
- 22.1k
- Forks
- 1.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
When using esm import .js or .jsx extensions is required. Trying to follow this requirement qwik fails to build with the following error:
Could not resolve "./components/router-head/router-head.jsx" from "src/s_qn6vsz8sp28.js"
error during build:
RollupError: Could not resolve "./components/router-head/router-head.jsx" from "src/s_qn6vsz8sp28.js"
at error (file:///home/app/node_modules/.pnpm/rollup@3.25.1/node_modules/rollup/dist/es/shared/node-entry.js:2213:30)
at ModuleLoader.handleInvalidResolvedId (file:///home/app/node_modules/.pnpm/rollup@3.25.1/node_modules/rollup/dist/es/shared/node-entry.js:24219:24)
at file:///home/app/node_modules/.pnpm/rollup@3.25.1/node_modules/rollup/dist/es/shared/node-entry.js:24181:26
// root.tsx
import { RouterHead } from "./components/router-head/router-head.jsx";
Reproduction
git clone https://github.com/ZiiMakc/tempnpm installnpm run build
Steps to reproduce
No response
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (8) x64 Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
Memory: 5.29 GB / 7.68 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.16.1 - /usr/bin/node
npm: 9.5.1 - /usr/bin/npm
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by cloning the linked reproduction, running npm install, and confirming the failure with npm run build. Inspect the Qwik Rollup/Vite plugin entry points involved in resolving the root.tsx import and compare behavior for TypeScript moduleResolution node16 and bundler. Done means the reproduction builds successfully with the explicit .jsx import.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rollup, typescript, vite
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100