-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Bug]: Critical dependency: require function is used in a way in which dependencies cannot be statically extracted. #21316
Comments
Possibly related to #21340 -- CJS in MJS? |
Could be! Can you look inside those referenced |
@yannbf what's the repro here? Is it the WP version of mealdrop? My guess is the problem comes from this file:
It looks like that storybook/code/addons/docs/src/preset.ts Line 100 in 47efd80
I changed that to an async import (is that OK @shilman?) in this PR. The chunk above is still generated, but now we only use |
Hmm, I noticed @yannbf mentioned the same problem coming from @ndelangen this one might be in your court. Any idea how we can stop |
@tmeasday the Looking at the issue/warning, it seems that the code meant for browsers created by Getting rid of that fallback code somehow seems like the right thing to do, indeed. |
@ndelangen well maybe this is a var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x + '" is not supported');
});
export {
__require
}; The only place However the chunk is imported (unused, why?) in both import {
render,
renderToCanvas
} from "./chunk-EWX34TBR.mjs";
import "./chunk-AKU6F3WT.mjs"; |
I'll investigate @tmeasday |
Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.62 containing PR #21402 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Reopening this as not fixed due to #21822 And note that project is using |
I think this one may have gotten closed by accident, given I had said:
So I think we merged the PR just for neatness, not because we thought it would fix the issue. @ndelangen did you ever get anywhere with this one? |
@tmeasday The issue arises (I think) from the fact that we mix browser & node and ESM and CJS when generating I experimented here splitting it out: The goal was to have a list of entries for node files, and a list of browser files. However I ran into trouble with the presets core, that tries to resolve browser files from node. I've been considering using This issue happens when node imports the ESM file we created with faulty tsup config. storybook/scripts/prepare/bundle.ts Line 86 in 88eb083
The default platform for ESM is |
Any updates on this? We are also having this issue with version "7.0.2". |
no, not yet.. I've done more experiments on my test-branch, but no resolution yet. |
We've had the same error with docs (we don't use react, we use the html framework) since upgrading to version 7, which has been 7.0.4, 7.0.5 and 7.0.6 so far. I don't know how to reproduce it simply however, as our project is quite complicated. |
Same on html framework with sb 7.0.6. |
Yep, that's also where my investigation has taken me for |
Using 7.0.7 and this is the public repo where the error happens: https://github.com/dohomi/tamagui-kitchen-sink/tree/master/apps/storybook-react |
Same issue, 7.0.7 and html-webpack5 |
Same issue. SB 7.0.7 and React |
Also seeing it in Storybook 7.1.0-alpha.10 for |
I think I found the fix @tmeasday ! |
Working through a migration from 6.4.20 to 7.07 and came to this. After implementing a workaround for #21242 I'm hitting this wall now. |
@L-Triple-O -- I believe this is a warning -- is it stopping the compilation in your case? |
@tmeasday, It's not stopping the compilation and yes they are warnings at this point, but stories are not being rendered at all. |
@L-Triple-O OK, I'd suggest the stories not rendering is a different issue because I don't think it's a symptom observed by others experiencing this warning. I don't see anything in those screenshots that would really indicate what might be causing it. |
Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.12 containing PR #22330 that references this issue. Upgrade today to the
|
Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.8 containing PR #22330 that references this issue. Upgrade today to the
|
Hi,
|
@tuvshinbay4r Your error message clearly shows you're using |
I'm having this warn when updating to
|
same here |
Have you tried setting |
I keep seeing this warning when running storybook for my team ui kit it's running on storybook v7.5.3 and next v14.0.1 The warning seems to be coming from Adding the following in my Storybook config doesn't silence the warning
I created this discussion for it: #24757 |
I have cross posted. I am not sure if if this is the cause, but my hot reload is not working. |
Describe the bug
After migrating, I get HMR warnings in the browser regarding
Like so:
To Reproduce
https://github.com/yannbf/mealdrop
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: