Giter VIP home page Giter VIP logo

create-trello-powerup's People

Contributors

benwarwick-champion avatar jackgraves avatar jeffortlessly avatar

Stargazers

 avatar  avatar

Watchers

 avatar

create-trello-powerup's Issues

t.getRestApi() causes ApiNotConfiguredError exception

I encountered an errnorneous symptom as described below.
Please review it.

Thank you,

Symptom

t.getRestApi() causes ApiNotConfiguredError exception.

Reproduction

$npx @optro/create-trello-powerup

Select Card Back Section.

In CardBackSection.tsx, add a call to t.getRestApi() as follows:

function CardBackSection() {
  const t = useProvidedTrello();
  try {
    t.getRestApi();
    console.log('getRestApi succeed');
  }
  catch (error) {
    console.log('getRestApi caused Error');
    console.log(error);
  }
  …

The ApiNotConfiguredError exception is catched.

Description

This could be resolved by changing router.tsx as follows:

Before:

const t = window.TrelloPowerUp.iframe();

After:

const t = window.TrelloPowerUp.iframe(
  {
    appKey: '[My App Key]',
    appName: '[My App Name]'
  }
);

The generated src/dist/card-back-section.html file has the following tag:

<script src="https://p.trellocdn.com/power-up.min.js?key=[My App Key]"></script>

As long as checking the Trello API documentation, power-up.min.js does not accept the key parameter.

Same error occurrred when getRestApi() was called in capabilities directly.
This seems because src/capabilities does not specifiy appKey in windows.TrelloPowerUp.initialize().

Note

src/types/trello.d.ts seems to have wrong definitions in

  • windows.TrelloPowerUp.iframe() - parameter type
  • getRestApi() - returns undefined

Details

.env entries are all specified except for OPTRO_API_KEY. Since POWERUP_APP_KEY and POWERUP_NAME are embedded in the generated files correctly, .env seems to be okay.

stack trace

restApi::ApiNotConfiguredError: To use the API hel…io/powerup-addon-c0c790cbce0b99fe28c6.js:2:503316'}message: "To use the API helper, make sure you specify appKey and appName when you call TrelloPowerUp.iframe. See more at [https://developers.trello.com/v1.0/reference#rest-api"name](https://developers.trello.com/v1.0/reference#rest-api):
"restApi::ApiNotConfiguredError"stack: "restApi::ApiNotConfiguredError: To use the API helper, make sure you specify appKey and appName when you call TrelloPowerUp.iframe. See more at [https://developers.trello.com/v1.0/reference#rest-api\n](https://developers.trello.com/v1.0/reference#rest-api\n)
at ri.getRestApi ( [https://p.trellocdn.com/power-up.min.js?key=1a59b0b996756a3f890989f32677032e:1:135877)\n](https://p.trellocdn.com/power-up.min.js?key=1a59b0b996756a3f890989f32677032e:1:135877)\n)
at y ([https://zzzz-power-up.ngrok.io/powerup-src_card-back-section_CardBackSection_tsx-5db36bf6ab3ab96e7908.js:2:10561)\n](https://zzzz-power-up.ngrok.io/powerup-src_card-back-section_CardBackSection_tsx-5db36bf6ab3ab96e7908.js:2:10561)/n)
at bd ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:343250)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:343250)/n)
at Gf ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:364943)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:364943)/n)
at [https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:379647\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:379647/n)
at bp ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:380130)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:380130)/n)
at Nh ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:427344)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:427344)/n)
at hh ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:419176)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:419176)/n)
at ph ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:419061)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:419061)/n)
at fh ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:418827)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:418827)/n)
at Zm ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:417126)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:417126)/n)
at [https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:304707\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:304707/n)
at t.unstable_runWithPriority ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:504255)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:504255)/n)
at $l ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:304451)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:304451)/n)
at Kl ([https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:304652)\n](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:304652)/n)
at [https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:503316"[[Prototype](https://zzzz-power-up.ngrok.io/powerup-addon-c0c790cbce0b99fe28c6.js:2:503316%22%5b%5bPrototype)]]: t

ERR_UNHANDLED_REJECTION

when I run yarn watch

I get:
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".] {
code: 'ERR_UNHANDLED_REJECTION'
}

Newly generated project errors with "Non-string value passed to `ts.resolveTypeReferenceDirective`"

yarn run v1.22.19
$ webpack --config webpack.config.ts --mode=production
[webpack-cli] Failed to load '/Users/msaavedra/code/saavy-powerup/webpack.config.ts' config
[webpack-cli] Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    at Object.resolveTypeReferenceDirective (/Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:42537:18)
    at /Users/msaavedra/code/saavy-powerup/node_modules/ts-node/src/index.ts:623:55
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/Users/msaavedra/code/saavy-powerup/node_modules/ts-node/src/index.ts:622:33)
    at actualResolveTypeReferenceDirectiveNamesWorker (/Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:116674:163)
    at resolveTypeReferenceDirectiveNamesWorker (/Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:116974:26)
    at processTypeReferenceDirectives (/Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:118456:31)
    at findSourceFileWorker (/Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:118341:21)
    at findSourceFile (/Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:118196:26)
    at /Users/msaavedra/code/saavy-powerup/node_modules/typescript/lib/typescript.js:118148:85
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```

Unknown system error -88

Hi, I'm trying to run '''yarn watch''' on macos with homebrew, but i get the following error
'''
➜ yarn watch
yarn run v1.22.19
$ ts-node src/dev-watch.ts
⏰ 22:41 Checking Environmental Variables
⏰ 22:41 Creating a tunnel with ngrok for localhost:3000...
Error: spawn Unknown system error -88
at ChildProcess.spawn (node:internal/child_process:413:11)
at spawn (node:child_process:743:9)
at startProcess (/Users/simon/Workspace/trello-powerup/mtrello/node_modules/ngrok/process.js:39:16)
at getProcess (/Users/simon/Workspace/trello-powerup/mtrello/node_modules/ngrok/process.js:23:20)
at Object.connect (/Users/simon/Workspace/trello-powerup/mtrello/node_modules/ngrok/index.js:16:22)
at Object. (/Users/simon/Workspace/trello-powerup/mtrello/src/dev-watch.ts:30:7)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module.m._compile (/Users/simon/Workspace/trello-powerup/mtrello/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Object.require.extensions. [as .ts] (/Users/simon/Workspace/trello-powerup/mtrello/node_modules/ts-node/src/index.ts:1621:12) {
errno: -88,
code: 'Unknown system error -88',
syscall: 'spawn'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

'''

any ideas?

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.