-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Can not import react-popper, usePopper got undefined #10982
Comments
I'm experiencing the same issue here caused by an outdated dependency within As a short term workaround I have aliased package.json
|
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I have the same issue. One of my components depends on Pls, bump popper version 🙏 |
@reme3d2y can you use the workaround described above? turns out it's not a trivial upgrade due to some IE11-related compatibility issues. we'll try to get it sorted out in 6.0.x. |
@shilman sorry for late reply. workaround works, but we have to change import from Hmm, what if you apply this workaround inside storybook sources instead of updating react-popper? |
Unfortunately, I have the same issue. I just leave this comment here to be subscribed to this topic. |
@shilman I don't know how the isolation between modules work in SB... but upgrading react-popper doesn't seems to be a good long term solution. If a project uses a different version of react-popper (newer or older) there are good chances that this will break. Is there any Webpack configuration to solve this? (the proposed workaround doesn't work for me either). |
For those who don't want to use an alias for the package name in their source code, this workaround only touches dev dependencies and applies the change when the code is loaded by Storybook: // .storybook/main.js
async function popperWorkaround(config) {
config.module.rules = [
{
test: /\.js$/,
loader: 'string-replace-loader',
options: {
search: "from 'react-popper'",
replace: "from 'react-popper-storybook'",
},
},
...config.module.rules,
];
return config;
}
module.exports = {
webpackFinal: popperWorkaround,
}; // package.json
"devDependencies": {
"string-replace-loader": "2.3.0",
"react-popper-storybook": "npm:react-popper@^2.2.3",
} |
ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.1 containing PR #11827 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
Thanks a lot mate! |
@shilman We've come up against this issue. It does initially appear to be fixed by
Disabling |
Storybook uses webpack DLLs and it's causing various version conflict issues. I suspect this is one of them @codeth We're looking into getting rid of the DLLs in 6.1. I'm not sure about the workaround in the meantime. @ndelangen any ideas? |
Have we found a workaround for this? I'm currently blocked myself with using |
@handonam Try running storybook with --no-dll |
running it with |
Also on version |
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.28 containing PR #12874 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
¡Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.27 containing PR #12874 that references this issue. Upgrade today to the
|
Describe the bug
my project need to import
react-popper
and@popperjs/core
to use it.In old version
6.0.0-alpha.30
, it works.usePopper
is a hooks function.But when I upgrade storybook packages to 6.0.0-beta.17.
usePopper
becomes to undefined.some research
I tried to find the problem, in the process I noticed that some addon packages of storybook 6.0.0.beta, such as
@storybook/addon-docs
or@storybook/addon-a11y
, depend on thereact-popper-tooltip
package, andreact-popper-tooltip
depend onpopper.js@^1.14.7
.Maybe the storybook did not load the correct version of react-popper?
[email protected] does not have
usePopper
hooks function before 2.0.0.So i removed all addons configuration in
.storybook/main.js
, and it worked (imported usePopper was not undefined).by the way, i have great confidence that this is not a bug with
react-popper
itself.I don’t know if this problem is a personal case, I need some help or hints.
Code snippets
package.json
System:
Additional context
repo: https://github.com/HackPlan/UUI/tree/213b74ef90354459ac97ffcf8e83e7f3d180c982
The text was updated successfully, but these errors were encountered: