Giter VIP home page Giter VIP logo

app-sdk's People

Contributors

abhishek305 avatar amitkanswal avatar aravindbuilt avatar deepak-kharah avatar dependabot[bot] avatar hiteshshetty-dev avatar naveenctstack avatar priteshjain avatar ravencolevol avatar snyk-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

abhishek305

app-sdk's Issues

Cannot upload asset using Asset.uploadAsset() method

Hello. I'm trying to upload an asset using the UploadAssetModal component from the @contentstack/venus-components library, and the Asset.uploadAsset() method from @contentstack/app-sdk.
The Asset.uploadAsset method returns the error "No handler found for post message: stackOptionsQuery from http://localhost:3000 in ...", full error message is provided below.

The simplified setup is as follows.

const uploadAssetProps: any = {
 sdk,
 onSubmit,
 only: "code",
 multiple: false,
 upload: ({ files, options }: any) => {
  return sdk?.stack.Asset.uploadAsset(files, options)
   .then((res) => console.log('Upload result', res))
   .catch((err) => console.log('Upload error' ,err));
};
<Button onClick={() => openUploadAssetModal(uploadAssetProps)}>
 Upload Asset
</Button>

Error message:

Upload error Error: No handler found for post message: stackOptionsQuery from http://localhost:3000 in https://app.contentstack.com/
    at eval (eval at e.exports (vendor.bundle.js:1:1), <anonymous>:2000:23)
    at ZalgoPromise.try (eval at e.exports (vendor.bundle.js:1:1), <anonymous>:1303:29)
    at exports.RECEIVE_MESSAGE_TYPES._RECEIVE_MESSAGE_TYPE.<computed> [as postrobot_message_request] (eval at e.exports (vendor.bundle.js:1:1), <anonymous>:1998:34)
    at receiveMessage (eval at e.exports (vendor.bundle.js:1:1), <anonymous>:1896:57)
    at messageListener (eval at e.exports (vendor.bundle.js:1:1), <anonymous>:1916:9)
    at rt.<computed> [as postrobot_message_response] (index.js:2:23116)
    at ft (index.js:2:24840)
    at dt (index.js:2:24896)

Debug output by @contentstack/app-sdk:

[post-robot] fullpage :: app.contentstack.com/ 

	 #send response :: stackOptionsQuery :: http://localhost:3000 

{
  ack: "error",
  code: undefined,
  data: undefined,
  domain: "http://localhost:3000",
  error: "No handler found for post message: stackOptionsQuery from http://localhost:3000 in https://app.contentstack.com/\n at eval (eval at e.exports (https://app.contentstack.com/vendor.bundle.js?v=1.2.4:1:1), <anonymous>:2000:23)\n at ZalgoPromise.try (eval at e.exports (https://app.contentstack.com/vendor.bundle.js?v=1.2.4:1:1), <anonymous>:1303:29)\n at exports.RECEIVE_MESSAGE_TYPES._RECEIVE_MESSAGE_TYPE.<computed> [as postrobot_message_request] (eval at e.exports (https://app.contentstack.com/vendor.bundle.js?v=1.2.4:1:1), <anonymous>:1998:34)\n at receiveMessage (eval at e.exports (https://app.contentstack.com/vendor.bundle.js?v=1.2.4:1:1), <anonymous>:1896:57)\n at messageListener (eval at e.exports (https://app.contentstack.com/vendor.bundle.js?v=1.2.4:1:1), <anonymous>:1916:9)"
  hash: "stackOptionsQuery_bb3c7fbad8",
  id: "58ee04db3d",
  name: "stackOptionsQuery",
  sourceDomain: "https://app.contentstack.com",
  target: undefined,
  type: "postrobot_message_response",
  windowType: "fullpage"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.