-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
build error in SWR 2.2.0 #96
Comments
same kind of code run success in storybook and next.js |
BTW, SWR 2.1.5 works |
I think because they update the |
https://unpkg.com/browse/[email protected]/package.json
Yeah, it's because this new condition is added in Hmm, wait, your file is under "use client". So, we should simply ignore it on server bundling? |
waku dev works, but not for build |
diff --git a/src/lib/builder.ts b/src/lib/builder.ts
index 4c87114..a9cfe11 100644
--- a/src/lib/builder.ts
+++ b/src/lib/builder.ts
@@ -62,7 +62,7 @@ const analyzeEntries = async (entriesFile: string) => {
ssr: {
noExternal: /^(?!node:)/,
// FIXME this is very adhoc.
- external: ["react", "minimatch"],
+ external: ["react", "minimatch", "swr"],
},
resolve: {
conditions: ["react-server"], That ☝️ seems to work around the build error. This is slightly related with #79, but we don't have a good workaround for this. |
Hi, thanks for jumping in. |
The latest version
Can anyone investigate it?? Not sure if it is somehow related with #111. |
Upstream: vercel/swr#2700
repo: https://github.com/himself65/affine-waku/blob/issue-swr/src/Counter.tsx
The text was updated successfully, but these errors were encountered: