-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Next 13: experimental appDir breaks useSWR #42249
Comments
I think the problem is that you are using |
|
@shuding that doesn't seem like a solution considering this problem is happening in the If you look at the reproduction link I posted you can see that there isn't an |
Thought it was in app/ — yeah that's indeed a bug if it happens in pages/! |
It seems that the repro is missing the |
Thanks for your input @lukemorales and that's indeed the case! Although Next.js shouldn't behavior like that, at least shouldn't throw such a strange error. Let me see if I can fix it or improve the error. |
It was fixed in version 13.0.2 |
happened to me too on version 13.0.2, removed the app dir experimental feature and worked again |
One potential risk is ESM dependencies that can't be bundled will cause a build error. This also means that the `esmExternals` configuration will be affected. Closes #42249, closes #42588. Related: #1395. ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.12.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.0.1-canary.2
eslint-config-next: 13.0.0
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Default Home component from
yarn create next-app
errors with
TypeError: Cannot read properties of null (reading 'useContext')
with an invalid hook call warningremoving
from
next.config.js
resolves the issue.Expected Behavior
useSWR should work when the experimental app directory is enabled
Link to reproduction
https://stackblitz.com/edit/vercel-next-js-arthzt?file=pages/index.tsx
To Reproduce
use
and
useSWR
fromswr
togetherThe text was updated successfully, but these errors were encountered: