Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i use the cp-axios,but i got this error #1

Open
nightost opened this issue Dec 7, 2020 · 4 comments
Open

i use the cp-axios,but i got this error #1

nightost opened this issue Dec 7, 2020 · 4 comments

Comments

@nightost
Copy link

nightost commented Dec 7, 2020

sample

onst cpAxios= require('cp-axios');
 const CPromise= require('c-promise2');
 const url= 'https://run.mocky.io/v3/753aa609-65ae-4109-8f83-9cfe365290f0?mocky-delay=5s';
 
 // you could use any other AbortController implementation, but CPromise already provides it
 const abortController = new CPromise.AbortController();
 const {signal} = abortController;
 
 cpAxios(url, {signal})
      .timeout(5000)
      .then(response => {
          console.log(`Done: ${JSON.stringify(response.data)}`)
      }, err => {
          console.warn(`Request failed: ${err}`)
      });
 
 setTimeout(() => {
    abortController.abort();
 }, 500);

error

Uncaught (in promise) TypeError: Cannot read property 'bind' of undefined
    at new CPromise (c-promise.umd.js:623)
    at CPAxios.request (CPAxios.js:27)
    at wrap (bind.js:9)
    at axios.js:319
    at new Promise (<anonymous>)
    at new F (_export.js:36)
    at $axios (axios.js:87)
    at Object.getAuthorizedDepartmentList (assetBlock.js:178)
    at VueComponent._callee3$ (DashboardQuery.vue:117)
    at tryCatch (runtime.js:45)

image
maybe, i can't use babel for this c-prosemise.umd.js

@DigitalBrainJS
Copy link
Owner

DigitalBrainJS commented Dec 7, 2020

Thanks for the info! Hmm, I tried many times to find a way to reproduce the problem, but currently, I have nothing to work with. I suppose this could be a problem with the dependencies tree, or something went wrong with your project bundler. I see that the code of c-promise2.umd is at least 0.10.x version, but cp-axios 0.1.7 normally should import 0.4.2 version. Just in case I have updated the package dependencies to the latest versions because recently I have published c-promise2 v0.10.x, which has some breaking changes.
In any case, it would be nice to know what went wrong and why this.onCancel is undefined there despite the fact that it was defined
here

Would you like to share your dependences tree using npm ls --depth=1 ? :)
P.S. Just in case Here is a live "all in one demo", where you can play with cpAxios&CPomise&cpFetch&React.

@nightost
Copy link
Author

nightost commented Dec 8, 2020

Sorry to reply late.
I try to handle this error again, but fail~
I confused about Promise.onCancel in your code because i can't find onCancel in Promise api.
This is my deps:
├─┬ @riophae/vue-treeselect@0.4.0
│ ├── @babel/runtime@7.10.3
│ ├── babel-helper-vue-jsx-merge-props@2.0.3 deduped
│ ├── easings-css@1.0.0
│ ├── fuzzysearch@1.0.3
│ ├── is-promise@2.2.2
│ ├── lodash@4.17.15 deduped
│ ├── material-colors@1.2.6
│ └── watch-size@2.0.0
├── @simonwep/selection-js@1.7.0
├── ag-grid-community@21.2.2
├── ag-grid-vue@21.2.2
├─┬ autoprefixer@6.7.7
│ ├── browserslist@1.7.7
│ ├── caniuse-db@1.0.30001085
│ ├── normalize-range@0.1.2
│ ├── num2fraction@1.2.2
│ ├── postcss@5.2.18
│ └── postcss-value-parser@3.3.1
├─┬ axios@0.19.2
│ └── follow-redirects@1.5.10
├─┬ axios-mock-adapter@1.18.1
│ ├── fast-deep-equal@3.1.3
│ └── is-buffer@2.0.4
├─┬ babel-core@6.26.3
│ ├── babel-code-frame@6.26.0
│ ├── babel-generator@6.26.1
│ ├── babel-helpers@6.24.1
│ ├── babel-messages@6.23.0
│ ├── babel-register@6.26.0 deduped
│ ├── babel-runtime@6.26.0
│ ├── babel-template@6.26.0
│ ├── babel-traverse@6.26.0
│ ├── babel-types@6.26.0
│ ├── babylon@6.18.0
│ ├── convert-source-map@1.7.0
│ ├── debug@2.6.9
│ ├── json5@0.5.1
│ ├── lodash@4.17.15 deduped
│ ├── minimatch@3.0.4
│ ├── path-is-absolute@1.0.1
│ ├── private@0.1.8
│ ├── slash@1.0.0
│ └── source-map@0.5.7
├─┬ babel-eslint@7.2.3
│ ├── babel-code-frame@6.26.0 deduped
│ ├── babel-traverse@6.26.0 deduped
│ ├── babel-types@6.26.0 deduped
│ └── babylon@6.18.0 deduped
├── babel-helper-vue-jsx-merge-props@2.0.3
├─┬ babel-loader@6.4.1
│ ├── find-cache-dir@0.1.1
│ ├── loader-utils@0.2.17
│ ├── mkdirp@0.5.5
│ └── object-assign@4.1.1
├─┬ babel-plugin-component@1.1.1
│ └── @babel/helper-module-imports@7.0.0-beta.35
├─┬ babel-plugin-istanbul@3.1.2
│ ├── find-up@1.1.2
│ ├── istanbul-lib-instrument@1.10.2
│ ├── object-assign@4.1.1 deduped
│ └── test-exclude@3.3.0
├─┬ babel-plugin-jsx-v-model@2.0.3
│ ├── babel-plugin-syntax-jsx@6.18.0 deduped
│ ├── html-tags@2.0.0
│ └── svg-tags@1.0.0
├── babel-plugin-syntax-dynamic-import@6.18.0
├── babel-plugin-syntax-jsx@6.18.0
├─┬ babel-plugin-transform-runtime@6.23.0
│ └── babel-runtime@6.26.0 deduped
├─┬ babel-plugin-transform-vue-jsx@3.7.0
│ └── esutils@2.0.3
├─┬ babel-polyfill@6.26.0
│ ├── babel-runtime@6.26.0 deduped
│ ├── core-js@2.6.11
│ └── regenerator-runtime@0.10.5
├─┬ babel-preset-env@1.7.0
│ ├── babel-plugin-check-es2015-constants@6.22.0
│ ├── babel-plugin-syntax-trailing-function-commas@6.22.0
│ ├── babel-plugin-transform-async-to-generator@6.24.1
│ ├── babel-plugin-transform-es2015-arrow-functions@6.22.0
│ ├── babel-plugin-transform-es2015-block-scoped-functions@6.22.0
│ ├── babel-plugin-transform-es2015-block-scoping@6.26.0
│ ├── babel-plugin-transform-es2015-classes@6.24.1
│ ├── babel-plugin-transform-es2015-computed-properties@6.24.1
│ ├── babel-plugin-transform-es2015-destructuring@6.23.0
│ ├── babel-plugin-transform-es2015-duplicate-keys@6.24.1
│ ├── babel-plugin-transform-es2015-for-of@6.23.0
│ ├── babel-plugin-transform-es2015-function-name@6.24.1
│ ├── babel-plugin-transform-es2015-literals@6.22.0
│ ├── babel-plugin-transform-es2015-modules-amd@6.24.1
│ ├── babel-plugin-transform-es2015-modules-commonjs@6.26.2
│ ├── babel-plugin-transform-es2015-modules-systemjs@6.24.1
│ ├── babel-plugin-transform-es2015-modules-umd@6.24.1
│ ├── babel-plugin-transform-es2015-object-super@6.24.1
│ ├── babel-plugin-transform-es2015-parameters@6.24.1
│ ├── babel-plugin-transform-es2015-shorthand-properties@6.24.1
│ ├── babel-plugin-transform-es2015-spread@6.22.0
│ ├── babel-plugin-transform-es2015-sticky-regex@6.24.1
│ ├── babel-plugin-transform-es2015-template-literals@6.22.0
│ ├── babel-plugin-transform-es2015-typeof-symbol@6.23.0
│ ├── babel-plugin-transform-es2015-unicode-regex@6.24.1
│ ├── babel-plugin-transform-exponentiation-operator@6.24.1
│ ├── babel-plugin-transform-regenerator@6.26.0
│ ├── browserslist@3.2.8
│ ├── invariant@2.2.4
│ └── semver@5.7.1 deduped
├─┬ babel-preset-es2015@6.24.1
│ ├── babel-plugin-check-es2015-constants@6.22.0 deduped
│ ├── babel-plugin-transform-es2015-arrow-functions@6.22.0 deduped
│ ├── babel-plugin-transform-es2015-block-scoped-functions@6.22.0 deduped
│ ├── babel-plugin-transform-es2015-block-scoping@6.26.0 deduped
│ ├── babel-plugin-transform-es2015-classes@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-computed-properties@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-destructuring@6.23.0 deduped
│ ├── babel-plugin-transform-es2015-duplicate-keys@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-for-of@6.23.0 deduped
│ ├── babel-plugin-transform-es2015-function-name@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-literals@6.22.0 deduped
│ ├── babel-plugin-transform-es2015-modules-amd@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-modules-commonjs@6.26.2 deduped
│ ├── babel-plugin-transform-es2015-modules-systemjs@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-modules-umd@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-object-super@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-parameters@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-shorthand-properties@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-spread@6.22.0 deduped
│ ├── babel-plugin-transform-es2015-sticky-regex@6.24.1 deduped
│ ├── babel-plugin-transform-es2015-template-literals@6.22.0 deduped
│ ├── babel-plugin-transform-es2015-typeof-symbol@6.23.0 deduped
│ ├── babel-plugin-transform-es2015-unicode-regex@6.24.1 deduped
│ └── babel-plugin-transform-regenerator@6.26.0 deduped
├─┬ babel-preset-stage-2@6.24.1
│ ├── babel-plugin-syntax-dynamic-import@6.18.0 deduped
│ ├── babel-plugin-transform-class-properties@6.24.1
│ ├── babel-plugin-transform-decorators@6.24.1
│ └── babel-preset-stage-3@6.24.1
├─┬ babel-register@6.26.0
│ ├── babel-core@6.26.3 deduped
│ ├── babel-runtime@6.26.0 deduped
│ ├── core-js@2.6.11 deduped
│ ├── home-or-tmp@2.0.0
│ ├── lodash@4.17.15 deduped
│ ├── mkdirp@0.5.5
│ └── source-map-support@0.4.18
├─┬ bpmn-js@3.5.0
│ ├── bpmn-font@0.8.0
│ ├── bpmn-moddle@5.2.0
│ ├── css.escape@1.5.1
│ ├── diagram-js@3.3.1
│ ├── diagram-js-direct-editing@1.6.1
│ ├── ids@0.2.2
│ ├── inherits@2.0.4
│ ├── min-dash@3.5.2
│ ├── min-dom@3.1.3
│ ├── object-refs@0.3.0
│ └── tiny-svg@2.2.2
├─┬ bpmn-js-properties-panel@0.33.2
│ ├── ids@1.0.0
│ ├── inherits@2.0.4 deduped
│ ├── lodash@4.17.15 deduped
│ ├── min-dom@3.1.3 deduped
│ ├── scroll-tabs@1.0.1
│ └── selection-update@0.1.2
├── c-promise2@0.10.4
├─┬ camunda-bpmn-moddle@3.2.0
│ └── min-dash@3.5.2 deduped
├─┬ chai@3.5.0
│ ├── assertion-error@1.1.0
│ ├── deep-eql@0.1.3
│ └── type-detect@1.0.0
├─┬ chalk@1.1.3
│ ├── ansi-styles@2.2.1
│ ├── escape-string-regexp@1.0.5
│ ├── has-ansi@2.0.0
│ ├── strip-ansi@3.0.1
│ └── supports-color@2.0.0
├─┬ chromedriver@2.46.0
│ ├── del@3.0.0
│ ├── extract-zip@1.7.0
│ ├── mkdirp@0.5.5
│ ├── request@2.88.2
│ └── tcp-port-used@1.0.1
├── classnames@2.2.6
├── connect-history-api-fallback@1.6.0
├─┬ cp-axios@0.1.8
│ ├── axios@0.21.0
│ └── c-promise2@0.10.4 deduped
├─┬ cross-env@3.2.4
│ ├── cross-spawn@5.1.0 deduped
│ └── is-windows@1.0.2
├─┬ cross-spawn@5.1.0
│ ├── lru-cache@4.1.5
│ ├── shebang-command@1.2.0
│ └── which@1.3.1
├─┬ css-loader@0.26.4
│ ├── babel-code-frame@6.26.0 deduped
│ ├── css-selector-tokenizer@0.7.2
│ ├── cssnano@3.10.0
│ ├── loader-utils@1.4.0
│ ├── lodash.camelcase@4.3.0
│ ├── object-assign@4.1.1 deduped
│ ├── postcss@5.2.18 deduped
│ ├── postcss-modules-extract-imports@1.2.1
│ ├── postcss-modules-local-by-default@1.2.0
│ ├── postcss-modules-scope@1.1.0
│ ├── postcss-modules-values@1.3.0
│ └── source-list-map@0.1.8
├── decimal.js@10.2.0
├─┬ echart@0.1.3
│ ├── koa@2.13.0
│ └── koa-router@7.4.0
├─┬ echarts@4.8.0
│ └── zrender@4.3.1
├── element-class@0.2.2
├─┬ element-ui@2.13.2
│ ├── async-validator@1.8.5
│ ├── babel-helper-vue-jsx-merge-props@2.0.3 deduped
│ ├── deepmerge@1.5.2
│ ├── normalize-wheel@1.0.1
│ ├── resize-observer-polyfill@1.5.1
│ └── throttle-debounce@1.1.0
├── escape-html@1.0.3
├─┬ UNMET PEER DEPENDENCY eslint@3.19.0
│ ├── babel-code-frame@6.26.0 deduped
│ ├── chalk@1.1.3 deduped
│ ├── concat-stream@1.6.2
│ ├── debug@2.6.9
│ ├── doctrine@2.1.0
│ ├── escope@3.6.0
│ ├── espree@3.5.4
│ ├── esquery@1.3.1
│ ├── estraverse@4.3.0
│ ├── esutils@2.0.3 deduped
│ ├── file-entry-cache@2.0.0
│ ├── glob@7.1.6
│ ├── globals@9.18.0
│ ├── ignore@3.3.10
│ ├── imurmurhash@0.1.4
│ ├── inquirer@0.12.0
│ ├── is-my-json-valid@2.20.0
│ ├── is-resolvable@1.1.0
│ ├── js-yaml@3.7.0
│ ├── json-stable-stringify@1.0.1
│ ├── levn@0.3.0
│ ├── lodash@4.17.15 deduped
│ ├── mkdirp@0.5.5
│ ├── natural-compare@1.4.0
│ ├── optionator@0.8.3
│ ├── path-is-inside@1.0.2
│ ├── pluralize@1.2.1
│ ├── progress@1.1.8
│ ├── require-uncached@1.0.3
│ ├── shelljs@0.7.8 deduped
│ ├── strip-bom@3.0.0
│ ├── strip-json-comments@2.0.1
│ ├── table@3.8.3
│ ├── text-table@0.2.0
│ └── user-home@2.0.0
├── eslint-config-standard@6.2.1
├─┬ eslint-friendly-formatter@2.0.7
│ ├── chalk@1.1.3 deduped
│ ├── extend@3.0.2
│ ├── minimist@1.2.5
│ └── text-table@0.2.0 deduped
├─┬ eslint-loader@1.9.0
│ ├── loader-fs-cache@1.0.3
│ ├── loader-utils@1.4.0 deduped
│ ├── object-assign@4.1.1 deduped
│ ├── object-hash@1.3.1
│ └── rimraf@2.7.1
├─┬ eslint-plugin-html@2.0.3
│ └── htmlparser2@3.10.1
├── eslint-plugin-promise@3.8.0
├── eslint-plugin-standard@2.3.1
├─┬ eslint-plugin-vue@6.2.2
│ ├── UNMET PEER DEPENDENCY eslint@>=5.0.0
│ ├── natural-compare@1.4.0 deduped
│ ├── semver@5.7.1 deduped
│ └── vue-eslint-parser@7.1.0
├── eventsource-polyfill@0.9.6
├── expose-loader@0.7.5
├─┬ express@4.17.1
│ ├── accepts@1.3.7
│ ├── array-flatten@1.1.1
│ ├── body-parser@1.19.0
│ ├── content-disposition@0.5.3
│ ├── content-type@1.0.4
│ ├── cookie@0.4.0
│ ├── cookie-signature@1.0.6
│ ├── debug@2.6.9
│ ├── depd@1.1.2
│ ├── encodeurl@1.0.2
│ ├── escape-html@1.0.3 deduped
│ ├── etag@1.8.1
│ ├── finalhandler@1.1.2
│ ├── fresh@0.5.2
│ ├── merge-descriptors@1.0.1
│ ├── methods@1.1.2
│ ├── on-finished@2.3.0
│ ├── parseurl@1.3.3
│ ├── path-to-regexp@0.1.7
│ ├── proxy-addr@2.0.6
│ ├── qs@6.7.0
│ ├── range-parser@1.2.1
│ ├── safe-buffer@5.1.2
│ ├── send@0.17.1
│ ├── serve-static@1.14.1
│ ├── setprototypeof@1.1.1
│ ├── statuses@1.5.0
│ ├── type-is@1.6.18
│ ├── utils-merge@1.0.1
│ └── vary@1.1.2
├─┬ extract-text-webpack-plugin@2.0.0-rc.3
│ ├── ajv@4.11.8
│ ├── async@2.6.3
│ ├── loader-utils@0.2.17
│ └── webpack-sources@0.1.5
├── faker@4.1.0
├─┬ file-loader@0.10.1
│ └── loader-utils@1.4.0 deduped
├── file-saver@2.0.2
├─┬ form-making@1.2.8
│ ├── axios@0.18.1
│ ├── clipboard@2.0.6
│ ├── element-ui@2.13.2 deduped
│ ├── normalize.css@8.0.1 deduped
│ ├── qiniu@7.3.1
│ ├── qiniu-js@2.5.5
│ ├── viewerjs@1.6.1
│ ├── vue@2.6.11 deduped
│ ├── vue-i18n@5.0.3
│ ├── vue-router@3.3.4 deduped
│ ├── vue2-editor@2.10.2
│ └── vuedraggable@2.23.2 deduped
├─┬ friendly-errors-webpack-plugin@1.7.0
│ ├── chalk@1.1.3 deduped
│ ├── error-stack-parser@2.0.6
│ └── string-width@2.1.1
├── function-bind@1.1.1
├─┬ gridstack@0.4.0
│ ├── jquery@3.5.1 deduped
│ ├── jquery-ui@1.12.1 deduped
│ └── lodash@4.17.15 deduped
├── highlight.js@9.18.1
├─┬ html-webpack-plugin@2.30.1
│ ├── bluebird@3.7.2
│ ├── html-minifier@3.5.21
│ ├── loader-utils@0.2.17
│ ├── lodash@4.17.15 deduped
│ ├── pretty-error@2.1.1
│ └── toposort@1.0.7
├─┬ html5-tag@0.3.0
│ └── escape-html@1.0.3 deduped
├─┬ http-proxy-middleware@0.17.4
│ ├── http-proxy@1.18.1
│ ├── is-glob@3.1.0
│ ├── lodash@4.17.15 deduped
│ └── micromatch@2.3.11
├─┬ husky@4.2.5
│ ├── chalk@4.1.0
│ ├── ci-info@2.0.0
│ ├── compare-versions@3.6.0
│ ├── cosmiconfig@6.0.0
│ ├── find-versions@3.2.0
│ ├── opencollective-postinstall@2.0.3
│ ├── pkg-dir@4.2.0
│ ├── please-upgrade-node@3.2.0
│ ├── slash@3.0.0
│ └── which-pm-runs@1.0.0
├─┬ inject-loader@2.0.1
│ └── loader-utils@0.2.17
├─┬ is-dom@1.1.0
│ ├── is-object@1.0.1
│ └── is-window@1.0.2
├── jquery@3.5.1
├─┬ jquery-slimscroll@1.3.8
│ └── jquery@3.5.1 deduped
├── jquery-ui@1.12.1
├─┬ json-server@0.9.6
│ ├── body-parser@1.19.0 deduped
│ ├── chalk@1.1.3 deduped
│ ├── compression@1.7.4
│ ├── connect-pause@0.1.0
│ ├── cors@2.8.5
│ ├── errorhandler@1.5.1
│ ├── express@4.17.1 deduped
│ ├── json-parse-helpfulerror@1.0.3
│ ├── lodash@4.17.15 deduped
│ ├── lodash-id@0.13.0
│ ├── lowdb@0.15.5
│ ├── method-override@2.3.10
│ ├── morgan@1.10.0
│ ├── object-assign@4.1.1 deduped
│ ├── pluralize@3.1.0
│ ├── request@2.88.2 deduped
│ ├── server-destroy@1.0.1
│ ├── shortid@2.2.15
│ ├── update-notifier@1.0.3
│ └── yargs@6.6.0
├─┬ karma@1.7.1
│ ├── bluebird@3.7.2 deduped
│ ├── body-parser@1.19.0 deduped
│ ├── chokidar@1.7.0
│ ├── colors@1.1.2
│ ├── combine-lists@1.0.1
│ ├── connect@3.7.0
│ ├── core-js@2.6.11 deduped
│ ├── di@0.0.1
│ ├── dom-serialize@2.2.1
│ ├── expand-braces@0.1.2
│ ├── glob@7.1.6 deduped
│ ├── graceful-fs@4.2.4
│ ├── http-proxy@1.18.1 deduped
│ ├── isbinaryfile@3.0.3
│ ├── lodash@3.10.1
│ ├── log4js@0.6.38
│ ├── mime@1.6.0
│ ├── minimatch@3.0.4 deduped
│ ├── optimist@0.6.1
│ ├── qjobs@1.2.0
│ ├── range-parser@1.2.1 deduped
│ ├── rimraf@2.7.1 deduped
│ ├── safe-buffer@5.1.2 deduped
│ ├── socket.io@1.7.3
│ ├── source-map@0.5.7
│ ├── tmp@0.0.31
│ └── useragent@2.3.0
├─┬ karma-coverage@1.1.2
│ ├── dateformat@1.0.12
│ ├── istanbul@0.4.5
│ ├── lodash@4.17.15 deduped
│ ├── minimatch@3.0.4 deduped
│ └── source-map@0.5.7
├─┬ karma-mocha@1.3.0
│ └── minimist@1.2.0
├─┬ karma-phantomjs-launcher@1.0.4
│ ├── lodash@4.17.15 deduped
│ └── phantomjs-prebuilt@2.1.16 deduped
├─┬ karma-sinon-chai@1.3.4
│ └── lolex@1.6.0 deduped
├─┬ karma-sourcemap-loader@0.3.7
│ └── graceful-fs@4.2.4 deduped
├─┬ karma-spec-reporter@0.0.26
│ └── colors@0.6.2
├─┬ karma-webpack@2.0.13
│ ├── async@2.6.3 deduped
│ ├── babel-runtime@6.26.0 deduped
│ ├── loader-utils@1.4.0 deduped
│ ├── lodash@4.17.15 deduped
│ ├── source-map@0.5.7
│ └── webpack-dev-middleware@1.12.2 deduped
├── lodash@4.17.15
├── lolex@1.6.0
├── mkdirp@1.0.4
├─┬ mocha@3.5.3
│ ├── browser-stdout@1.3.0
│ ├── commander@2.9.0
│ ├── debug@2.6.8
│ ├── diff@3.2.0
│ ├── escape-string-regexp@1.0.5 deduped
│ ├── glob@7.1.1
│ ├── growl@1.9.2
│ ├── he@1.1.1
│ ├── json3@3.3.2
│ ├── lodash.create@3.1.1
│ ├── mkdirp@0.5.1
│ └── supports-color@3.1.2
├─┬ mockjs@1.1.0
│ └── commander@5.1.0
├── moment@2.27.0
├── mxgraph@3.9.12
├─┬ nightwatch@0.9.21
│ ├── chai-nightwatch@0.1.1
│ ├── ejs@2.5.7
│ ├── lodash.clone@3.0.3
│ ├── lodash.defaultsdeep@4.3.2
│ ├── minimatch@3.0.3
│ ├── mkpath@1.0.0
│ ├── mocha-nightwatch@3.2.2
│ ├── optimist@0.6.1 deduped
│ ├── proxy-agent@2.0.0
│ └── q@1.4.1
├─┬ node-sass@4.12.0
│ ├── async-foreach@0.1.3
│ ├── chalk@1.1.3 deduped
│ ├── cross-spawn@3.0.1
│ ├── gaze@1.1.3
│ ├── get-stdin@4.0.1
│ ├── glob@7.1.6 deduped
│ ├── in-publish@2.0.0
│ ├── lodash@4.17.15 deduped
│ ├── meow@3.7.0
│ ├── mkdirp@0.5.5
│ ├── nan@2.14.1
│ ├── node-gyp@3.8.0
│ ├── npmlog@4.1.2
│ ├── request@2.88.2 deduped
│ ├── sass-graph@2.2.4
│ ├── stdout-stream@1.4.1
│ └── true-case-path@1.0.3
├─┬ node-xlsx@0.15.0
│ ├── buffer-from@1.1.1
│ └── xlsx@0.14.5
├── normalize.css@8.0.1
├─┬ npm-run-all@4.1.5
│ ├── ansi-styles@3.2.1
│ ├── chalk@2.4.2
│ ├── cross-spawn@6.0.5
│ ├── memorystream@0.3.1
│ ├── minimatch@3.0.4 deduped
│ ├── pidtree@0.3.1
│ ├── read-pkg@3.0.0
│ ├── shell-quote@1.7.2
│ └── string.prototype.padend@3.1.0
├─┬ opn@4.0.2
│ ├── object-assign@4.1.1 deduped
│ └── pinkie-promise@2.0.1
├─┬ ora@1.4.0
│ ├── chalk@2.4.2
│ ├── cli-cursor@2.1.0
│ ├── cli-spinners@1.3.1
│ └── log-symbols@2.2.0
├─┬ phantomjs-prebuilt@2.1.16
│ ├── es6-promise@4.2.8
│ ├── extract-zip@1.7.0 deduped
│ ├── fs-extra@1.0.0
│ ├── hasha@2.2.0
│ ├── kew@0.7.0
│ ├── progress@1.1.8 deduped
│ ├── request@2.88.2 deduped
│ ├── request-progress@2.0.1
│ └── which@1.3.1 deduped
├── popper.js@1.16.1
├── qs@6.9.4
├─┬ query-string@5.1.1
│ ├── decode-uri-component@0.2.0
│ ├── object-assign@4.1.1 deduped
│ └── strict-uri-encode@1.1.0
├─┬ sass-loader@7.3.1
│ ├── clone-deep@4.0.1
│ ├── loader-utils@1.4.0 deduped
│ ├── neo-async@2.6.1
│ ├── pify@4.0.1
│ └── semver@6.3.0
├── selenium-server@3.141.59
├── semver@5.7.1
├─┬ shelljs@0.7.8
│ ├── glob@7.1.6 deduped
│ ├── interpret@1.4.0
│ └── rechoir@0.6.2
├─┬ UNMET PEER DEPENDENCY sinon@1.17.7
│ ├── formatio@1.1.1
│ ├── lolex@1.3.2
│ ├── samsam@1.1.2
│ └── util@0.12.3
├── sinon-chai@2.14.0
├─┬ sockjs-client@1.4.0
│ ├── debug@3.2.6
│ ├── eventsource@1.0.7
│ ├── faye-websocket@0.11.3
│ ├── inherits@2.0.4 deduped
│ ├── json3@3.3.3
│ └── url-parse@1.4.7
├── sortablejs@1.10.2
├─┬ style-loader@0.23.1
│ ├── loader-utils@1.4.0 deduped
│ └── schema-utils@1.0.0
├── tinymce@4.9.10
├─┬ url-loader@0.5.9
│ ├── loader-utils@1.4.0 deduped
│ └── mime@1.3.6
├── uuidjs@4.2.5
├── vue@2.6.11
├── vue-click-outside@1.1.0
├─┬ vue-echarts@4.1.0
│ ├── lodash@4.17.15 deduped
│ └── resize-detector@0.1.10
├─┬ vue-grid-layout@2.3.11
│ ├── @interactjs/actions@1.10.0
│ ├── @interactjs/auto-start@1.10.0
│ ├── @interactjs/dev-tools@1.10.0
│ ├── @interactjs/interactjs@1.10.0
│ ├── @interactjs/modifiers@1.10.0
│ └── element-resize-detector@1.2.1
├─┬ vue-highlightjs@1.3.3
│ └── highlight.js@9.18.1 deduped
├── vue-i18n@8.18.2
├─┬ vue-loader@14.2.4
│ ├── consolidate@0.14.5
│ ├── hash-sum@1.0.2
│ ├── loader-utils@1.4.0 deduped
│ ├── lru-cache@4.1.5
│ ├── postcss@6.0.23
│ ├── postcss-load-config@1.2.0
│ ├── postcss-selector-parser@2.2.3
│ ├── prettier@1.19.1
│ ├── resolve@1.17.0
│ ├── source-map@0.6.1
│ ├── vue-hot-reload-api@2.3.4
│ ├── vue-style-loader@4.1.2
│ └── vue-template-es2015-compiler@1.9.1
├─┬ vue-print-nb@1.5.0
│ ├── core-js@2.6.11 deduped
│ ├── echarts@4.8.0 deduped
│ ├── qrcodejs2@0.0.2
│ └── vue@2.6.11 deduped
├─┬ UNMET PEER DEPENDENCY vue-property-decorator@8.5.1
│ └── vue-class-component@7.2.3
├── vue-router@3.3.4
├─┬ vue-style-loader@3.1.2
│ ├── hash-sum@1.0.2 deduped
│ └── loader-utils@1.4.0 deduped
├─┬ vue-template-compiler@2.6.11
│ ├── de-indent@1.0.2
│ └── he@1.2.0
├─┬ vuedraggable@2.23.2
│ └── sortablejs@1.10.2 deduped
├── vuex@2.5.0
├── vxe-table@2.9.13
├─┬ UNMET PEER DEPENDENCY webpack@3.12.0
│ ├── acorn@5.7.4
│ ├── acorn-dynamic-import@2.0.2
│ ├── ajv@6.12.2
│ ├── ajv-keywords@3.5.0
│ ├── async@2.6.3 deduped
│ ├── enhanced-resolve@3.4.1
│ ├── escope@3.6.0 deduped
│ ├── interpret@1.4.0 deduped
│ ├── json-loader@0.5.7
│ ├── json5@0.5.1
│ ├── loader-runner@2.4.0
│ ├── loader-utils@1.4.0 deduped
│ ├── memory-fs@0.4.1
│ ├── mkdirp@0.5.5
│ ├── node-libs-browser@2.2.1
│ ├── source-map@0.5.7
│ ├── supports-color@4.5.0
│ ├── tapable@0.2.9
│ ├── uglifyjs-webpack-plugin@0.4.6
│ ├── watchpack@1.7.2
│ ├── webpack-sources@1.4.3
│ └── yargs@8.0.2
├─┬ webpack-bundle-analyzer@2.13.1
│ ├── acorn@5.7.4 deduped
│ ├── bfj-node4@5.3.1
│ ├── chalk@2.4.2
│ ├── commander@2.20.3
│ ├── ejs@2.5.7 deduped
│ ├── express@4.17.1 deduped
│ ├── filesize@3.6.1
│ ├── gzip-size@4.1.0
│ ├── lodash@4.17.15 deduped
│ ├── mkdirp@0.5.5
│ ├── opener@1.5.1
│ └── ws@4.1.0
├─┬ webpack-dev-middleware@1.12.2
│ ├── memory-fs@0.4.1 deduped
│ ├── mime@1.6.0
│ ├── path-is-absolute@1.0.1 deduped
│ ├── range-parser@1.2.1 deduped
│ └── time-stamp@2.2.0
├─┬ webpack-hot-middleware@2.25.0
│ ├── ansi-html@0.0.7
│ ├── html-entities@1.3.1
│ ├── querystring@0.2.0
│ └── strip-ansi@3.0.1 deduped
├─┬ webpack-merge@2.6.1
│ └── lodash@4.17.15 deduped
├── UNMET PEER DEPENDENCY xe-utils@1.9.8
└─┬ xlsx@0.16.2
├── adler-32@1.2.0
├── cfb@1.1.4
├── codepage@1.14.0
├── commander@2.17.1
├── crc-32@1.2.0
├── exit-on-epipe@1.0.1
├── ssf@0.10.3
└── wmf@1.0.2

@DigitalBrainJS
Copy link
Owner

DigitalBrainJS commented Dec 8, 2020

Sorry to reply late.

That's ok, besides we're in different timezones :)

I confused about Promise.onCancel in your code because I can't find onCancel in Promise api.

Yeah, they were missed in the documentation. API docs generated automatically by the jsdoc2md package and it doesn't recognize jsdoc annotations with @name tag in the code for dynamically generated methods.
I have just added them to the readme in a bit tricky way.
So, are you still getting the same error? It seems you transform your code into es5, maybe it corrupts the c-promise2.umd.js module in some way.
You can try to find this code block in the umd bundle and put a breakpoint there to check whether methods are appending successfully to the CPromise.prototype. It's more likely that the problem is there- perhaps it somehow messed up after bundling your application? And after the previous check use another breakpoint there to check the reference to the onCancel method.

@nightost
Copy link
Author

nightost commented Dec 9, 2020

ok,i'll try it again.
tks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants