#bmizerany1234

1 messages ยท Page 1 of 1 (latest)

sour kettleBOT
radiant cave
#

I clipped off:

dawn oyster
#

Hmm, have it worked before? And are you just starting development with Stripe App?

radiant cave
#

It was working

#

Then I tried to reinvent html forms the way the docs said. Now I'm getting this.

dawn oyster
#

Could you clarify exactly what changed?

sour kettleBOT
radiant cave
#

I modified some JSX and then that happened. I made a handfull of changes and I'm not commiting to source control for every line I change so I'm not 100% sure

#

I can't get it to work anymore

hybrid hare
#

Hi there ๐Ÿ‘‹ taking over, as my colleague needs to step away

Are you able to revert to the previous state and instead make incremental changes to see what specifically broke it for you?

radiant cave
#

There is the little JSX I made that resulted in "corrupted" ext.js

#

not to be smug but: Can Stripe give me a decent error?

#

Is there a verbose mode lurking behind some hidden cli flag or something

#

I've began stepping back but still no luck

hybrid hare
#

Let me see if I can loop in someone with a bit more context than me. Just a minute

radiant cave
#

thank you

unique heart
#

Hi ๐Ÿ‘‹ I'm jumping in here

Give me a sec to catch up

radiant cave
#

Thank you!

unique heart
#

Okay so did you just get started, following one of our docs?

#

And in your backward stepping you have not reached a state where stripe apps start runs?

radiant cave
#

I mean yeah, but that was a month ago

#

I commented out the useState code and now it renders

#

but that is odd because now those are undefined and stripe is okay with that haha

unique heart
#

When you say "now it renders" do you mean the app loads properly without the error displayed?

#

Sorry but we need to be very explicit about the exact behavior you are seeing

radiant cave
#

I mean that in the most literal sense:

unique heart
#

In that the elements you are creating do not appear at all? No error, just nothing?

radiant cave
#

now if I uncomment any of those commented out lines, it will "reload" and render .. HOWEVER if I do nothing else and then restart the stripe apps whatever run then I get that nasty unhelpful error about being corrupt again

unique heart
#

Do you mean running stripe apps start?

radiant cave
unique heart
#

What happens if you remove the onChange logic from the Code text field?

radiant cave
#

I removed them all one-by-one and nothing happened but when I got ride of the useState stuff it all rendered

#

but obviously doesn't update state

unique heart
#

And what is the full text of the error message logged to the console? Please copy/paste text rather than screenshot

radiant cave
#

I removed all the inputs

#

one useState and boom... nasty error

unique heart
#

The error message would be most helpful

radiant cave
#

@unique heart an error message would be very helpful. I wish it would produce one.

unique heart
#

I'm trying to help but screenshots and videos don't provide me the information I need.

radiant cave
#

What else can I help with?

#

happy to provide everything I have

unique heart
#

Please copy/paste the text of the error message logged to the console

radiant cave
#

which is very little since Stripe tools are not giving me anything

unique heart
#

Thank you

radiant cave
#

np

unique heart
#

Digging into this. What is the specific command you call to spin up your Stripe app?

radiant cave
#

stripe apps start

unique heart
#

We're trying to replicate this issue

radiant cave
#

Thank you

unique heart
#

So you are uncommenting the [code, setCode] line for useState, correct? Is that used anywhere elese besides the <TextField>?

#

Are you attempting to use the code const somewhere outside the component?

radiant cave
#

looking

#

There is no use of code outside or inside the component

#

This error happens when any of the useState things are uncommented

unique heart
#

Ah, wait. useState needs to occur within a component

radiant cave
#

That is what is happening

#

Here is a useState that works in the same "component" / view / whatever React calls it

#

That works great

#

and it defined at the same level as the others that cause the error

unique heart
radiant cave
#

How is what I'm doing not in a component

#

oooooooh

#

wow

#

I see now

#

I'm almost out of heartburn medicine after all of this React

unique heart
#

I find React hooks especially frustrating myself, so I get it

radiant cave
#

It would dope if one could just use a <form>

unique heart
#

That would be ideal

radiant cave
#

It is so strange my other useState worked outside the "component"

#

oh it isn't

#

ha

#

sorry

unique heart
#

But for now we just need to keep our useState and whatever other React weirdness within each App component.

For instance, in my app I have a Charge screen

const Charge = ({ userContext, environment }: ExtensionContextValue) => {
  // Creating stateful variables for our Stripe data
  const [charge, setCharge] = useState<Stripe.Charge>();
#

If I move that useState<Stripe.Charge>() call to above the const Charge line, I see the same error

#

Looks fine in the hot reload, but refresh the page and it's all broken

radiant cave
#

HEY! It works now. Thank you so much

#

yeah I moved it into the "component" and it's all good

#

what a journey

unique heart
#

Awesome ๐ŸŽ‰

#

I'm glad we were able to get it figured out