Error: Failed to collect page data
Unanswered
Anhinga posted this in #help-forum
AnhingaOP
Hey I have this during my build :/
My next.config:
My next.config:
// @ts-check
const path = require("path");
const withNextIntl = require("next-intl/plugin")();
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
experimental: {
outputFileTracingRoot: path.join(__dirname, "../"),
},
};
module.exports = withNextIntl(config);68 Replies
AnhingaOP
My folder structure:
AnhingaOP
All my pages are like this
function ClaimsPage() {
return <div>ClaimsPage</div>;
}
export default ClaimsPage;Boston Terrier
Try deleting,
check the
.next and re build.check the
lint and if the ts can complie it self or not.AnhingaOP
I did it 3 hundred times x) it's like it's coming from external lib but it's possible ?
Open the locale/claims/page.tsx and send the entire file @Anhinga
It's an empty page
I detected that my error comes from this hook
Will check when I'm on my pc
AnhingaOP
Can you tell me when approx?
@Arinji Will check when I'm on my pc
AnhingaOP
I would like to call u :3
My case is not easy...
AnhingaOP
And the thing I don't understand is that hook works in next 13 ... but not in 14 xD
@Anhinga this code looks incomplete.. is this your page.tsx?
AnhingaOP
+ the build doesnt work but the npm run dev works xd
Yes but the rest is coming from my layouts
do you have any getStaticParams code anywhere?
AnhingaOP
And its occur to all my nested pages under this layout that is calling that hook
Nop everything is ssr
can you do one thing
take the entirety of your client code
put it in its own component called ClientWrapper
and call that in your page,tsx, and keep it server (just without use client)
AnhingaOP
Because idk but its like the problem is coming from the hook
And the hook is client side
Im calling it in a wrapper in my layout
its not, the issue is that its trying to ssg your page
and something inside your code needs an active nodejs server, which is not present on build
AnhingaOP
You can't call?
recode it to page.tsx and add export const dynamic = "force-dynamic" at the top.
AnhingaOP
Hum but I wouldnt force all my pages to dynamic
not on the layout
inside the page.tsx
you already mentioned you want it to be ssr
client page is probs causing issues with the nextjs compiler
AnhingaOP
I have my intercepting route in client
but shouldnt make any issue ?
export const dynamic = "force-dynamic"
function StakingPage() {
return <div>StakingPage</div>;
}
export default StakingPage;Still ahve the error
The error is gone after removing the hook from my wrapper
Which hook?
AnhingaOP
I sent you the whole code
@Anhinga Click to see attachment
AnhingaOP
useConnector
is your layout also a client?
where are you importing useConnector from?
AnhingaOP
I'm calling
useInitConnector in a <Providers> wrapper in a layoutshow Providers
AnhingaOP
Im gonna push to public repository and send you the link
kk
AnhingaOP
its the same i changed the name in case it was used by ts x)
and i keep one side page
to test
since all are empty
you will not be able to run build since im using private registries from npm
I have to go if you find something gg if not Im available on monday (Im from France so idk your timezone)
Ah, yea i was about to ask abt the private registeries.. sorry no idea.
AnhingaOP
Ahahh yeah i cant :/
Monday we can call?
Because tbh Im starting to have no hopes for this😭
2days already trying to fix😭
AnhingaOP
Thanks in advance!
Serengeti
I am facing the same issue. Have you figured out the problem?
I am also facing the same issue when deploying