-
Notifications
You must be signed in to change notification settings - Fork 72
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
Infinite loop with 401 errors #96
Comments
Think this is #92. Try moving the token down to the component and removing |
Tried moving |
This helped fix my issues. I noticed you had: import { withDesign } from 'storybook-addon-designs';
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: { expanded: true },
decorators: [withDesign],
design: { accessToken: '<private-access-token>' },
}; Instead I put withDesign on my individual components (not globally set like this) Working repro is: export default {
decorators: [withDesign],
title: 'Buttons',
component: PrimaryButton,
}
const Template: Story<unknown> = args => <PrimaryButton {...args} />;
export const Primary = Template.bind({});
Primary.args = {
text: 'Button',
type: 'primary',
onPress: () => null,
disabled: false,
isInProgress: false,
compact: false
};
Primary.parameters = {
design: {
url: 'designURL'
}
};
export const PrimaryDisabled = Template.bind({});
PrimaryDisabled.args = {
...Primary.args,
disabled: true
};
PrimaryDisabled.parameters = {
design: {
url: 'designURL'
}
}; |
So it's impossible to set |
You only have to set it on the default stories, so it's not too bad IMO |
I just tried this:
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: { expanded: true },
};
import { withDesign } from 'storybook-addon-designs';
export default {
title: 'MyComponent',
decorators: [withDesign],
argTypes: {
// ...
},
};
// ...
export const MyComponent = Template.bind({});
MyComponent.parameters = {
design: {
type: 'figma',
url: 'https://www.figma.com/file/...',
accessToken: '<private-access-token>',
},
}; It did not help. |
At first, this is nothing related to #92, as this issue is for These errors are results of Figma Live Embed Kit (= scripts inside If you believe the cause is at the addon instead of at the loaded iframe content, please provide an actual and expected behavior, not just errors. |
That is very valuable information! It was not clear when I was reading the docs. I would appreciate it if you could add this information to the docs. I figured it out. The 401 errors and the infinite loop were caused by the fact that I have the "Block third-party cookies" feature enabled in Google Chrome: I added my Storybook host to exceptions and now it works: Thank you! |
🤯 Given the world's movement toward more-privacy-focused-internet, I'll add a section of the third-party cookie stuff to docs. |
Worth noting that this doesn't work with Safari still, but that's because Safari has a bit of an all or nothing approach to privacy so it's the browser not the plugin. |
When I try to open the "Design" panel, it goes into an infinite loop trying to load the Figma file.
The following appears in the console:
This is my setup:
.storybook/preview.js
MyComponent.stories.js
The text was updated successfully, but these errors were encountered: