Skip to content

v0.34.0 - TypeError: Cannot read property 'done' of undefined (cache.done()) #421

@jschill

Description

@jschill

What happens and why it is incorrect

On v0.34 I get:
TypeError: Cannot read property 'done' of undefined
...and it points to cache.done() in index.ts that was recently changed.

Downgrading to v0.33.0.1 v0.32 "solves" the problem.

Environment

Versions

System:
    OS: macOS 12.5.1
    CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
    Memory: 103.09 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node
    Yarn: 1.22.18 - ~/.yarn/bin/yarn
    npm: 6.14.17 - ~/.nvm/versions/node/v14.20.0/bin/npm
    Watchman: 2022.08.29.00 - /usr/local/bin/watchman
  npmPackages:
    rollup: 2.79.0 => 2.79.0
    rollup-plugin-typescript2: ^0.34.0 => 0.34.0

rollup.config.js

:
import ts from 'rollup-plugin-typescript2';
export default {
  input: 'src/client/index.ts',
  plugins: [
    ts({
      tsconfig: './tsconfig.json',
      check: false,
      verbosity: 3
    })],
  output: {
    dir: 'output',
    format: 'cjs'
  },
};

tsconfig.json

:
{
    "extends": "../tsconfig.base.json",
    "transpileOnly": true,
    "compilerOptions": {
        "rootDir": "./..",
        "baseUrl": "./src",
        "allowJs": true,
        "target": "es3",
        "jsx": "react",
        "jsxFactory": "h",
        "jsxFragmentFactory": "Fragment",
        "noLib": false,
        "outDir": "build/",
        "noEmitHelpers": true,
        "preserveConstEnums": true,
        "suppressImplicitAnyIndexErrors": true,
        "importHelpers": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "sourceMap": true,
        "inlineSources": true,
        "allowSyntheticDefaultImports": true
    },
    "include": [
        "src/**/*.js",
        "src/**/*.jsx",
        "src/**/*.ts",
        "src/**/*.tsx"
    ],
    "exclude": [
        "node_modules",
        "**/*.spec.ts"
    ]
}

package.json

:

plugin output with verbosity 3

:
npm run rollup:build

> @ rollup:build /Users/johannes/Documents/workspace/sirjunkalot/packages/web
> rollup --config rollup.config.js


src/client/index.ts → output...
[!] (plugin rpt2) TypeError: Cannot read property 'done' of undefined
TypeError: Cannot read property 'done' of undefined
    at buildDone (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup-plugin-typescript2/src/index.ts:82:9)
    at Object.buildEnd (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup-plugin-typescript2/src/index.ts:295:5)
    at /Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/shared/rollup.js:22848:40
    at async Promise.all (index 0)
    at PluginDriver.hookParallel (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/shared/rollup.js:22776:9)
    at /Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/shared/rollup.js:23744:13
    at catchUnfinishedHookActions (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/shared/rollup.js:23216:20)
    at rollupInternal (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/shared/rollup.js:23734:5)
    at build (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/bin/rollup:1528:20)
    at runRollup (/Users/johannes/Documents/workspace/sirjunkalot/packages/web/node_modules/rollup/dist/bin/rollup:1668:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: dxImprovements to dev experience, e.g. error messages, logging, external-facing docs, etckind: regressionSpecific type of bug -- past behavior that worked is now brokenproblem: no reproNo reproduction was provided (and have not tried to repro without one)scope: cacheRelated to the cachescope: testsTests could be improved. Or changes that only affect tests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions