Commit ff415cb8 by Tomáš Hübelbauer

Include a fix for the Rollup+TypeScript issue

parent 2e906612
# Rollup
## `rollup-plugin-typescript2` Issue
[The issue](
Running `tsc -p .` works, running `rollup -c` doesn't. What gives?
## Installing
`yarn global add rollup`
......@@ -15,7 +9,8 @@ I am using a fork with a fix that was preventing me from seeing TypeScript erros
- `yarn add adrianheine/rollup#sourcemap`
- `cd node_modules/rollup`
- `yarn`
- `rollup -c`
- `cd ../..`
- `yarn start`
The above allowed me to obtain and build the fork and in addition to it, I've changed the invocation of `rollup` to:
......@@ -61,7 +56,24 @@ The *real* TypeScript plugin, `rollup-plugin-typescript` does not support TS2.
## Troubleshooting
Try setting up with TypeScript again.
**Cannot call a namespace**:
Happens when using Rollup with code like this:
import * as qrcode from 'qrcode-generator';
The fix is this:
import * as qrcode_ from 'qrcode-generator';
const qrcode: typeof qrcode_ = qrcode_;
// WTF I know…
**“version” is a required argument**:
[There is now a PR with a fix, see the related todo](
- [Catch errors when following source maps in error reporting](
- [Error: “version” is a required argument](
This only obscures the real underlying issue, which is often *Cannot call a namespace* as seen above.
import * as jsqr from 'jsqr';
import * as qrcode from 'qrcode-generator';
import * as qrcode_ from 'qrcode-generator';
const qr = qrcode(0, 'H');
const qrcode: typeof qrcode_ = qrcode_;
const qr: QRCode = qrcode(0, 'H');
window.addEventListener('load', _ => {
"rules": {
"quotemark": [ true, "single" ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment