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

[@rollup/plugin-typescript] Cannot resolve input filepath which is absolute path and begin with lower case drive letter on windows #1703

Open
JohnLee1243 opened this issue Apr 13, 2024 · 0 comments

Comments

@JohnLee1243
Copy link

Expected Behavior

Build Successed.

Actual Behavior

d:/rollup-typescript-plugin-absolute-path/src/main.ts → dist...
[!] RollupError: ../../d:/rollup-typescript-plugin-absolute-path/src/main.ts (1:21): Expected ',', got ':' (Note that you need plugins to import files that are not JavaScript)
../../d:/rollup-typescript-plugin-absolute-path/src/main.ts (1:21)
1: export function foo(a: number) {
                        ^
2:   console.log(a);
3: }
RollupError: Expected ',', got ':'
    at Object.getRollupError (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\parseAst.js:282:41)
    at ParseError.initialise (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:12611:40)
    at convertNode (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:14356:10)
    at convertProgram (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:13673:12)
    at Module.setSource (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:15510:24)
    at async ModuleLoader.addModuleSource (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:19819:13)
  [cause] RollupError: Expected ',', got ':'
      at Object.getRollupError (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\parseAst.js:282:41)
      at ParseError.initialise (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:12611:40)
      at convertNode (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:14356:10)
      at convertProgram (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:13673:12)
      at Module.setSource (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:15510:24)
      at async ModuleLoader.addModuleSource (D:\rollup-typescript-plugin-absolute-path\node_modules\rollup\dist\shared\rollup.js:19819:13)

Additional Information

This problem occurs on the windows. I download the project to disk D:/ and decompress it. If the input is absolute path and starts with D:/. It will build successfully, but if the absolute path of input starts with 'd:/', error above happens. In my opinion, for drive letter both upper and lower case should be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant