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

Watch mode breaks when editing style files. #178

Closed
diego-toro opened this issue Apr 15, 2022 · 2 comments
Closed

Watch mode breaks when editing style files. #178

diego-toro opened this issue Apr 15, 2022 · 2 comments

Comments

@diego-toro
Copy link

  • Version: 2.0.6
  • Rollup Version: 2.70.2
  • Operating System and version (if applicable): macOS 12.2.1
  • Node Version (if applicable): v16.14.2 (npm v8.5.0)
  • Does it work with tsc (if applicable): N/A

Reproduction

When working on watch mode

rollup -c -w

An error pops up when trying to edit a .module.scss

Here is a sample code to replicate the issue https://github.com/diego-toro/rollup-ts-reexport-bug.

  1. Clone the repo
  2. Start running the app: npm run start
  3. Try to edit the .module.scss file
  4. You should get an error

Expected Behavior

Rebuilds code

Actual Behavior

Throws an error after editing a .module.scss file when rollup in watch mode

[!] (plugin Typescript) TypeError: Cannot read properties of null (reading 'length')
TypeError: Cannot read properties of null (reading 'length')
    at iterateCommentRanges (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:10470:45)
    at reduceEachLeadingCommentRange (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:10561:16)
    at Object.getLeadingCommentRanges (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:10576:16)
    at Object.getJSDocCommentRanges (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:15302:16)
    at addJSDocComment (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:31050:42)
    at parseSourceFileWorker (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:31023:34)
    at Object.parseSourceFile (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:30855:26)
    at Object.createSourceFile (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/typescript/lib/typescript.js:30653:29)
    at CompilerHost.constructSourceFile (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/rollup-plugin-ts/dist/cjs/index.js:7700:37)
    at CompilerHost.add (/Users/diegotoro/code/rollup-ts-reexport-bug/node_modules/rollup-plugin-ts/dist/cjs/index.js:7660:37)
@wessberg
Copy link
Owner

Fixed in v2.0.7. Sorry about that!

@diego-toro
Copy link
Author

Awesome! thanks

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

2 participants