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

Drive letter bug on win32 platforms in TSCache in typescript plugin #1133

Closed
lovettchris opened this issue Mar 11, 2022 · 5 comments
Closed

Comments

@lovettchris
Copy link
Contributor

  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 8.3.1
  • Rollup Version: 2.70.0
  • Operating System (or Browser): Windows 11
  • Node Version: v16.14.0
  • Link to reproduction (⚠️ read below):
  1. on windows, make a "d:\Temp" folder cd into that folder
  2. git clone https://github.com/vtec234/vscode-lean4
  3. git checkout infoview-hooks
  4. npm install
  5. npx lerna bootstrap
  6. npx lerna run build

(note the lean4-infoview uses rollup)

Expected Behavior

Build succeeds on Linux, but fails on Windows.

Actual Behavior

Notice the drive letter included in the .rollup.cache path below, which makes for an invalid Windows path.

exception has occurred: Error: ENOENT: no such file or directory, mkdir '.rollup.cache\d:\Temp\vtec234\vscode-lean4\lean4-infoview\dist\infoview'
  at Object.mkdirSync (node:fs:1336:3)
    at createFileFolder (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\@rollup\plugin-typescript\dist\index.js:690:28)
    at TSCache.cacheCode (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\@rollup\plugin-typescript\dist\index.js:703:9)
    at Object.writeFile (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\@rollup\plugin-typescript\dist\index.js:750:37)
    at Object.writeFile (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\typescript\lib\typescript.js:18270:14)
    at printSourceFileOrBundle (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\typescript\lib\typescript.js:108715:24)
    at emitJsFileOrBundle (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\typescript\lib\typescript.js:108600:13)
    at emitSourceFileOrBundle (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\typescript\lib\typescript.js:108523:13)
    at forEachEmittedFile (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\typescript\lib\typescript.js:108262:34)
    at Object.emitFiles (D:\Temp\vtec234\vscode-lean4\lean4-infoview\node_modules\typescript\lib\typescript.js:108503:9)
Note: Using the "preview" debug extension

I have another pull request resolves one problem.

Which unblocks this problem.

Additional Information

@shellscape
Copy link
Collaborator

Thanks for the issue. Please note the bit in the issue template about acceptable reproductions:

🚨 Issues WITHOUT a valid reproduction WILL BE CLOSED!

Please provide one by:

  1. Using the REPL.it plugin reproduction template at https://repl.it/@rollup/rollup-plugin-repro
  2. Provide a minimal repository link (Read https://git.io/fNzHA for instructions).
    Please use NPM for installing dependencies!
    These may take more time to triage than the other options.
  3. Using the Rollup REPL at https://rollupjs.org/repl/

Please give https://git.io/fNzHA a read. The repo you've linked as your reproduction is definitely not minimal. We keep them simple as we're short on help and time is precious.

@timvahlbrock
Copy link

Can confirm this. The TSCache is just replacing capital drive letters:

return path.join(this._cacheFolder, fileName.replace(/^([A-Z]+):/, '$1'));

I will see if I can provide a minimal reproduction repo tomorrow.

@timvahlbrock
Copy link

timvahlbrock commented Mar 15, 2022

Also this doesn't seem to be limited to win32, had this issue on some win64 as well. Also seems to be related to the shell that's used.

@timvahlbrock
Copy link

Reproduction Repository: https://github.com/timvahlbrock/repro-rollup-ts-lower-case-drive-letters

Created #1141 to fix this.

@shellscape
Copy link
Collaborator

big thanks to @timvahlbrock and @lovettchris for both submitting PRs to fix this and for helping with this issue

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

3 participants