-
-
Notifications
You must be signed in to change notification settings - Fork 613
Closed
Labels
Description
- Rollup Plugin Name: @rollup/plugin-typescript
- Rollup Plugin Version: 11.1.6
- Rollup Version: 4.13.2
- Operating System (or Browser): Browser (Stackblitz)
- Node Version: 18.18.0
- Link to reproduction: https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-751pte?file=folder%2Fpackage.json,folder%2Frollup.config.js,script1.ts,folder%2Fscript2.ts
Expected Behavior
When bundling folder/script2.ts (from inside folder) rollup should be able to understand that import {helloWorld} from '../script1' refers to ../script1.ts, and bundle it with no errors.
Actual Behavior
I get this error:
[!] RollupError: Could not resolve "../script1" from "script2.ts"
script2.ts
at getRollupError (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/parseAst.js:282:41)
at Object.error (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/parseAst.js:278:42)
at ModuleLoader.handleInvalidResolvedId (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/rollup.js:20000:36)
at eval (/home/projects/stackblitz-webcontainer-api-starter-751pte/folder/node_modules/rollup/dist/shared/rollup.js:19960:26)Additional Information
This problem does not acre:
- When
folder/script2.tsandscript1.tsare in the same folder. - When the project root (i.e. the
package.json) is in/and not/folder. - When using javascript files instead of typescript ones.
- When importing
../script1.tsinstead of../script1or../script1.js(though typescript's compiler is not happy about that, you have to enableallowImportingTsExtensionsin the tsconfig)
For all of these reasons I believe that this is a bug and not an intended feature.
markpsiano and neustroev