Skip to content

Commit 75bdd02

Browse files
committed
nextjs does not support fallbacks for export because?
1 parent 6cda25b commit 75bdd02

File tree

6 files changed

+7
-12
lines changed

6 files changed

+7
-12
lines changed

docs/pages/production-error/[code].js docs/pages/production-error.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from 'react';
22
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
33
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';
44

5-
const pageFilename = 'production-error/[code]';
5+
const pageFilename = 'production-error';
66
const requireDemo = require.context('docs/src/pages/production-error', false, /\.js$/);
77
const requireRaw = require.context(
8-
'!raw-loader!../../src/pages/production-error',
8+
'!raw-loader!../src/pages/production-error',
99
false,
1010
/\.(js|md)$/,
1111
);

docs/src/modules/components/AppFrame.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function AppFrame(props) {
188188
let navIconClassName = '';
189189
let appBarClassName = classes.appBar;
190190

191-
if (!activePage || activePage.disableDrawer === true) {
191+
if (activePage?.disableDrawer === true) {
192192
disablePermanent = true;
193193
appBarClassName += ` ${classes.appBarHome}`;
194194
} else {

docs/src/modules/components/MarkdownDocs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function MarkdownDocs(props) {
100100

101101
const { activePage, pages } = React.useContext(PageContext);
102102
const pageList = flattenPages(pages);
103-
const currentPageNum = findIndex(pageList, (page) => page.pathname === activePage.pathname);
103+
const currentPageNum = findIndex(pageList, (page) => page.pathname === activePage?.pathname);
104104
const currentPage = pageList[currentPageNum];
105105
const prevPage = pageList[currentPageNum - 1];
106106
const nextPage = pageList[currentPageNum + 1];

docs/src/pages.js

-5
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ const pages = [
129129
],
130130
},
131131
{ title: 'Component API', ...findPages[0] },
132-
{
133-
title: 'Production Error',
134-
pathname: '/production-error',
135-
children: [{ pathname: '/production-error/[code]' }],
136-
},
137132
{
138133
pathname: '/styles',
139134
children: [

docs/src/pages/production-error/[code].md docs/src/pages/production-error/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ We recommend using the development build when debugging this error.
66
It will include additional warnings about potential problems.
77
If you encounter an exception while using the production build, this page will reassemble the orrigianl text of the error.
88

9-
{{"demo": "pages/production-error/[code]/ErrorDecoder.js", "hideToolbar": true, "bg": "inline"}}
9+
{{"demo": "pages/production-error/ErrorDecoder.js", "hideToolbar": true, "bg": "inline"}}

packages/material-ui-utils/src/formatMuiErrorMessage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export default function formatMuiErrorMessage(code) {
88
// loose mode is safe iff we're concatenating primitives
99
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
1010
/* eslint-disable prefer-template */
11-
let url = 'https://material-ui.com/production-error/' + code + '/?';
11+
let url = 'https://material-ui.com/production-error/?code=' + code;
1212
for (let i = 1; i < arguments.length; i += 1) {
1313
// rest params over-transpile for this case
1414
// eslint-disable-next-line prefer-rest-params
15-
url += 'args[]=' + encodeURIComponent(arguments[i]) + '&';
15+
url += '&args[]=' + encodeURIComponent(arguments[i]);
1616
}
1717
return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.';
1818
/* eslint-enable prefer-template */

0 commit comments

Comments
 (0)