Skip to content

Does not work with async plugins #105

@vwxyutarooo

Description

@vwxyutarooo

What happens and why it is wrong

This plugin does not work with plugin which containing async/await syntax caused by object-hash issue and tscache.ts. I think this is hard to fix object-hash because there is no way to detect asyncfunction now. So is there any alternative without object-hash?

Environment

Versions

  • typescript: 2.8.3
  • rollup: 2.1.1
  • rollup-plugin-typescript2: 0.14.0

rollup.config.js

import svgr from '@svgr/rollup';
import typescript from 'rollup-plugin-typescript2';

export default {
  // ...
  plugins: [
    replace({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }),
    svgr(),
    typescript({
      useTsconfigDeclarationDir: true,
    })
  ],
  // ...
};

tsconfig.json

No relevant.

package.json

No relevant.

plugin output with verbosity 3

[!] (rpt2 plugin) Error: Unknown object type "asyncfunction"
src/components/atoms/Icon/index.ts
Error: Unknown object type "asyncfunction"
    at Object._object (/Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:218:17)
    at Object._function (/Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:319:14)
    at Object.dispatch (/Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:185:30)
    at /Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:246:18
    at Array.forEach (<anonymous>)
    at Object._object (/Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:242:21)
    at Object.dispatch (/Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:185:30)
    at /Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:260:23
    at Array.forEach (<anonymous>)
    at Object._array (/Users/vwxyutarooo/Projects/kouzoh/mercari-web-jp-component/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:259:20)

Metadata

Metadata

Assignees

Labels

kind: bugSomething isn't working properlyscope: cacheRelated to the cachescope: integrationRelated to an integration, not necessarily to core (but could influence core)scope: upstreamIssue in upstream dependencysolution: workaround availableThere is a workaround available for this issue

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions