You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read properties of undefined (reading 'slice')
at getCodeFrame (file:///home/projects/rollup-repro-wmdqgq/node_modules/rollup/dist/shared/rollup.js:150:65)
at augmentCodeLocation (file:///home/projects/rollup-repro-wmdqgq/node_modules/rollup/dist/shared/rollup.js:288:28)
at Module.addLocationToLogProps (file:///home/projects/rollup-repro-wmdqgq/node_modules/rollup/dist/shared/rollup.js:14193:13)
at Module.warn (file:///home/projects/rollup-repro-wmdqgq/node_modules/rollup/dist/shared/rollup.js:14075:14)
at resolveNamespaceVariables (file:///home/projects/rollup-repro-wmdqgq/node_modules/rollup/dist/shared/rollup.js:9876:24)
My understanding, when I debugged this, is it's trying to get the line number in the original source code, not in the transformed source code (sourcemaps don't exist) and it's throwing this error.
The text was updated successfully, but these errors were encountered:
Fix at #4922. The problem is that your plugin changes lines in a file without generating a sourcemap. This is a problem in so far as warnings and errors will report wrong locations. You should ideally use something like magic-string to generate a source map for your changes.
The fix will not fix the warning location but prevent the crash.
Rollup Version
3.18.0
Operating System (or Browser)
macOS Ventura
Node Version (if applicable)
No response
Link To Reproduction
https://stackblitz.com/edit/rollup-repro-wmdqgq?file=rollup.config.js,dist%2Fmain.js,src%2Fmain.js,package.json
Expected Behaviour
Working in 3.17.3: https://stackblitz.com/edit/rollup-repro-eeubaz?file=rollup.config.js,dist%2Fmain.js,src%2Fmain.js,package.json
Just warns about the missing export, but successfully completes compilation.
Actual Behaviour
Broken repro: https://stackblitz.com/edit/rollup-repro-wmdqgq?file=rollup.config.js,dist%2Fmain.js,src%2Fmain.js,package.json
Throws this error:
My understanding, when I debugged this, is it's trying to get the line number in the original source code, not in the transformed source code (sourcemaps don't exist) and it's throwing this error.
The text was updated successfully, but these errors were encountered: