Next.js Discord

Discord Forum

Failed to collect page data for /_not-found

Answered
Selkirk Rex posted this in #help-forum
Open in Discord
Selkirk RexOP
What does this error mean?
Answered by joulev
it uses client-side stuff so where you use it you need to use use client as it describes in its documentation
View full answer

11 Replies

Selkirk RexOP
I have no idea where to start -- this error seems a bit cryptic? Attached is my not-found.jsx
This error is while doing a build, this doesn't happen with the development server
Selkirk RexOP
oh yeah
before each of htese errors, theres this:
TypeError: _react.default.createContext is not a function
    at 85453 (/home/vsix/nextjs/levelstest/.next/server/chunks/6477.js:14542:38)
    at __webpack_require__ (/home/vsix/nextjs/levelstest/.next/server/webpack-runtime.js:25:43)
    at 63228 (/home/vsix/nextjs/levelstest/.next/server/chunks/6477.js:9520:24)
    at __webpack_require__ (/home/vsix/nextjs/levelstest/.next/server/webpack-runtime.js:25:43)
    at 39855 (/home/vsix/nextjs/levelstest/.next/server/chunks/6477.js:17813:18)
    at __webpack_require__ (/home/vsix/nextjs/levelstest/.next/server/webpack-runtime.js:25:43)
    at 39759 (/home/vsix/nextjs/levelstest/.next/server/chunks/6477.js:8140:14)
    at __webpack_require__ (/home/vsix/nextjs/levelstest/.next/server/webpack-runtime.js:25:43)
    at 10862 (/home/vsix/nextjs/levelstest/.next/server/chunks/8301.js:373:12)
    at Function.__webpack_require__ (/home/vsix/nextjs/levelstest/.next/server/webpack-runtime.js:25:43)
Selkirk RexOP
it seems to have been because i included this package https://github.com/Skyleen77/next-nprogress-bar
@Selkirk Rex it seems to have been because i included this package https://github.com/Skyleen77/next-nprogress-bar
it uses client-side stuff so where you use it you need to use use client as it describes in its documentation
Answer
Selkirk RexOP
right
i'm just not going to use it for now because it recommends making the layout a client component which i'd rather not do
@Selkirk Rex i'm just not going to use it for now because it recommends making the layout a client component which i'd rather not do
i wouldn't do that either, but you can follow [this approach](https://github.com/Skyleen77/next-nprogress-bar#second-approach-wrap-in-a-use-client-providers-component-1) which doesn't require making your root layout a client component (which is against nextjs' convention)
Selkirk RexOP
ohh i didnt notice that, thanks!