Skip to content

Commit

Permalink
nextjs does not support fallbacks for export because?
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed May 31, 2020
1 parent 6cda25b commit 75bdd02
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'production-error/[code]';
const pageFilename = 'production-error';
const requireDemo = require.context('docs/src/pages/production-error', false, /\.js$/);
const requireRaw = require.context(
'!raw-loader!../../src/pages/production-error',
'!raw-loader!../src/pages/production-error',
false,
/\.(js|md)$/,
);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function AppFrame(props) {
let navIconClassName = '';
let appBarClassName = classes.appBar;

if (!activePage || activePage.disableDrawer === true) {
if (activePage?.disableDrawer === true) {
disablePermanent = true;
appBarClassName += ` ${classes.appBarHome}`;
} else {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/MarkdownDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function MarkdownDocs(props) {

const { activePage, pages } = React.useContext(PageContext);
const pageList = flattenPages(pages);
const currentPageNum = findIndex(pageList, (page) => page.pathname === activePage.pathname);
const currentPageNum = findIndex(pageList, (page) => page.pathname === activePage?.pathname);
const currentPage = pageList[currentPageNum];
const prevPage = pageList[currentPageNum - 1];
const nextPage = pageList[currentPageNum + 1];
Expand Down
5 changes: 0 additions & 5 deletions docs/src/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ const pages = [
],
},
{ title: 'Component API', ...findPages[0] },
{
title: 'Production Error',
pathname: '/production-error',
children: [{ pathname: '/production-error/[code]' }],
},
{
pathname: '/styles',
children: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ We recommend using the development build when debugging this error.
It will include additional warnings about potential problems.
If you encounter an exception while using the production build, this page will reassemble the orrigianl text of the error.

{{"demo": "pages/production-error/[code]/ErrorDecoder.js", "hideToolbar": true, "bg": "inline"}}
{{"demo": "pages/production-error/ErrorDecoder.js", "hideToolbar": true, "bg": "inline"}}
4 changes: 2 additions & 2 deletions packages/material-ui-utils/src/formatMuiErrorMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export default function formatMuiErrorMessage(code) {
// loose mode is safe iff we're concatenating primitives
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
/* eslint-disable prefer-template */
let url = 'https://material-ui.com/production-error/' + code + '/?';
let url = 'https://material-ui.com/production-error/?code=' + code;
for (let i = 1; i < arguments.length; i += 1) {
// rest params over-transpile for this case
// eslint-disable-next-line prefer-rest-params
url += 'args[]=' + encodeURIComponent(arguments[i]) + '&';
url += '&args[]=' + encodeURIComponent(arguments[i]);
}
return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.';
/* eslint-enable prefer-template */
Expand Down

0 comments on commit 75bdd02

Please sign in to comment.