Skip to content

Commit

Permalink
workaround for (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Oct 27, 2021
1 parent 3965e2d commit a218dcc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/puppet/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* Huan(202110): Issue #168 - ReferenceError: Cannot access 'Puppet' before initialization
* @see https://github.com/wechaty/puppet/issues/168
*
* We need to import `interface-of.js` before import `puppet-abstract.js`
* or we will get the following error message:
*
* ReferenceError: Cannot access 'Puppet' before initialization
at file:///home/huan/git/wechaty/puppet/src/puppet/interface-of.ts:23:48
at ModuleJob.run (node:internal/modules/esm/module_job:175:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async Object.loadESM (node:internal/process/esm_loader:68:5)
* This is due to the circler dependence, the deeper reason is still not clear.
*/
import './interface-of.js'

import { PuppetSkelton } from './puppet-skelton.js'
import {
Puppet,
Expand Down

0 comments on commit a218dcc

Please sign in to comment.