-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Update with-react-esi example (type error) #8262
Comments
You have incorrectly configured your Babel configuration to cause this error. Be sure to not invoke Babel yourself, as Next already handles compiling these files for you. |
Ah, it appears this example was designed incorrectly. @lfades should we delete it? |
@Timer index.js require('@babel/register')({
presets: ['@babel/preset-env'],
ignore: ['node_modules', '.next'],
});
module.exports = require('./server.js'); package.json
React-ESI looks like the best page caching solution. Please, could you fix your example? |
Hi @Timer , this example project is no longer in the example repo. |
@Timer the example wasn't designed incorrectly. This has been discussed in the original PR (#6225 (comment)), and AFAIK, there is no better options right now. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Examples bug report
Example name
with-react-esi
Describe the bug
Unable to add custom _app.js file into a project. After creating and building the example via docker-compose up, an error occurs:
node_1 | TypeError: Class constructor App cannot be invoked without 'new' node_1 | at new MyApp (/usr/src/app/dist/.next/server/static/QWF1PHuowO_sU-px49ruG/pages/_app.js:196:102) node_1 | at c (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:323) node_1 | at Sa (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:1) node_1 | at a.render (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:467) node_1 | at a.read (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:58) node_1 | at renderToString (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:53:83) node_1 | at render (/usr/src/app/node_modules/next-server/dist/server/render.js:80:16) node_1 | at renderPage (/usr/src/app/node_modules/next-server/dist/server/render.js:237:20) node_1 | at /usr/src/app/dist/.next/server/static/QWF1PHuowO_sU-px49ruG/pages/_document.js:236:17 node_1 | at Generator.next (<anonymous>)
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
Wanted to add styled components provider to custom _app.js and run in production.
Screenshots
System information
Additional context
The text was updated successfully, but these errors were encountered: