You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Stripe App uses the same component for every screen, but I'd like it to have access to the objectContext so it can try retrieving the object and checking that it has the correct shape. However, if I use the same component for more than one viewport, the line gets duplicated in the generated build (.build/manifest.js) and causes an error.
To Reproduce
Steps to reproduce the behavior:
Initialize a fresh Stripe App, or take one you already have
Update the ui_extension.views field in stripe-app.json to include the same component for multiple viewports (example below)
Run stripe apps start and get a build error about the component already having been imported
I would expect the build script to de-dupe the set of exported components when generating .build/manifest.js and just re-use the name. More generally, I think the user should get to decide where they handle per-object variations in their component tree. While there may be different code for different objects, I don't think that necessarily means the user should have to create separate entry points.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: macOS Ventura, 13.5
Browser: Chrome
Version: 116.0.5845.96 (Official Build) (arm64)
Additional context
My usecase involves going through a series of prompts which ask you to create objects; each prompt includes a JSON schema of the expected object, as well as the names of the events to search for a matching object. As such, while the logic sort of varies for different objects, I'm leveraging the same components and functions every time.
I'm currently working around this by creating dedicated files for each viewport which all contain variations of:
// Stub to satisfy Stripe Apps assumption that each detail view// should map to a separate React component.importMainViewfrom'./MainView';exportconstCustomerView=MainView;exportdefaultCustomerView;
The text was updated successfully, but these errors were encountered:
Describe the bug
My Stripe App uses the same component for every screen, but I'd like it to have access to the
objectContext
so it can try retrieving the object and checking that it has the correct shape. However, if I use the same component for more than one viewport, the line gets duplicated in the generated build (.build/manifest.js
) and causes an error.To Reproduce
Steps to reproduce the behavior:
ui_extension.views
field instripe-app.json
to include the same component for multiple viewports (example below)stripe apps start
and get a build error about the component already having been importedExpected behavior
I would expect the build script to de-dupe the set of exported components when generating
.build/manifest.js
and just re-use the name. More generally, I think the user should get to decide where they handle per-object variations in their component tree. While there may be different code for different objects, I don't think that necessarily means the user should have to create separate entry points.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
My usecase involves going through a series of prompts which ask you to create objects; each prompt includes a JSON schema of the expected object, as well as the names of the events to search for a matching object. As such, while the logic sort of varies for different objects, I'm leveraging the same components and functions every time.
I'm currently working around this by creating dedicated files for each viewport which all contain variations of:
The text was updated successfully, but these errors were encountered: