Codesandbox-client: Next.js - custom _app.js not being detected in pages directory

Created on 23 Oct 2019  路  3Comments  路  Source: codesandbox/codesandbox-client

馃悰 bug report

Description of the problem

In a Next.js sandbox, adding a _app.js file to the pages directory to override/extend the default is not being detected by the sandbox. _app.js is not being included in the next.js build / dev process.

How has this issue affected you? What are you trying to accomplish?

I'm trying to experiment with persisting / manipulating components between page changes by adding layout and header components to _app.js

Link to sandbox: link (optional)

Your Environment

| Software | Name/Version |
| ---------------- | ------------ |
| 小odesandbox | PROD-1571674162-0e9c0cfe9
| Browser | Chrome 77.0.3865.120 (Official Build) (64-bit)
| Operating System | Mac OS Catalina 10.15

Need Info

Most helpful comment

I can guess what happened here.

When you add _app.js, you have to restart nextjs (as far as I know, it doesn't restart itself on _app.js creation)

On CodeSandbox, you can restart the server from the Server tab on the left.

Screenshot 2019-10-31 at 3 05 38 PM

I tested this scenario and it works well 馃憤

All 3 comments

Hey @eckmLJE ,

Did you get this to work in the meanwhile? It seems to be working now:

image

I can guess what happened here.

When you add _app.js, you have to restart nextjs (as far as I know, it doesn't restart itself on _app.js creation)

On CodeSandbox, you can restart the server from the Server tab on the left.

Screenshot 2019-10-31 at 3 05 38 PM

I tested this scenario and it works well 馃憤

If it doesn't work for you or if there is any additional context you'd like to add, feel free to reply here and we'll re-open this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarcelloTheArcane picture MarcelloTheArcane  路  3Comments

yazaabed picture yazaabed  路  3Comments

alansouzati picture alansouzati  路  3Comments

oskarabc picture oskarabc  路  3Comments

donavon picture donavon  路  3Comments