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

Transpiled SDK is broken in @vue/cli #197

Closed
davidyuk opened this issue Jan 4, 2019 · 1 comment
Closed

Transpiled SDK is broken in @vue/cli #197

davidyuk opened this issue Jan 4, 2019 · 1 comment

Comments

@davidyuk
Copy link
Member

davidyuk commented Jan 4, 2019

As I understand from this PR, the only adding of SDK package to list of sources for transpilation by babel-loader are necessary to use it, but actually, transpiled code throws the exception in default setup of @vue/cli project.

Expected Behavior

To don't throw the exception as if transpilation disabled.

Current Behavior

traverseKeys function of swagger.js throws expection:

VM2850 swagger.js:369 Uncaught (in promise) TypeError: While calling getStatus (), Object(...) is not a function
    at eval (VM2850 swagger.js:369)
    at Array.map (<anonymous>)
    at Object (VM2850 swagger.js:368)
    at eval (VM2850 swagger.js:380)
    at eval (VM2489 _curryN.js:38)
    at eval (VM2488 _arity.js:16)
    at snakizeKeys (VM2850 swagger.js:392)
    at Object._callee$ (VM2850 swagger.js:532)
    at tryCatch (VM2277 runtime.js:62)
    at Generator.invoke [as _invoke] (VM2277 runtime.js:288)

Possible Solution

Transpile SDK before publishing to npm (#196), or write a guide how to use SDK with @vue/cli.

Steps to Reproduce

$ npm i @vue/cli -g
$ vue create test-app
# chose default settings
$ cd test-app
$ npm i @aeternity/aepp-sdk@1.2.1

create vue.config.js containing:

module.exports = {
  transpileDependencies: ['@aeternity/aepp-sdk'],
};

add to src/main.js:

import { EpochChain } from '@aeternity/aepp-sdk/es'
const url = 'https://sdk-testnet.aepps.com'
EpochChain({ url, internalUrl: url })
$ npm run serve

then open developer console, exception should be raised

@davidyuk
Copy link
Member Author

Seems that it is fixed in the last versions

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

1 participant