I can reliably reproduce an unexpected behavior, but I don't know why it's happening. After starting my dev server the error occurs the first time I try to navigate to a route.
- I start the dev server in VS Code.
server log:
> dev
> next dev
▲ Next.js 13.5.4
- Local: http://localhost:3000
- Environments: .env.local
- Experiments (use at your own risk):
· serverActions
✓ Ready in 2.3s
- I navigate to
http://localhost:3000/login
server log:
✓ Compiled /middleware in 220ms (211 modules)
✓ Compiled /[locale]/login/page in 1345ms (2401 modules)
- I click on a link
<a href="/register">REGISTER</a>in a client component.
server log:
✓ Compiled /[locale]/register/page in 494ms (2412 modules)
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
client log:
[Log] [Fast Refresh] rebuilding
[Error] Fetch API cannot load http://localhost:3000/_next/static/webpack/e5d03f6071d39f73.webpack.hot-update.json due to access control checks.
(anonymous function) (webpack.js:1365)
[Warning] [Fast Refresh] performing full reload
Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree.
You might have a file which exports a React component but also exports a value that is imported by a non-React component file.
Consider migrating the non-React component export to a separate file and importing it into both files.
It is also possible the parent component of the component you edited is a class component, which disables Fast Refresh.
Fast Refresh requires at least one parent function component in your React tree.
The browser is not routed to /register. If I click on the link the second time, it works. How can I find out what is causing this behavior?