1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed next module loading and undefined document

This commit is contained in:
Fedor Katurov 2022-01-13 10:45:01 +07:00
parent de999a0f1f
commit f964011af1
4 changed files with 19 additions and 1 deletions

5
next.config.js Normal file
View file

@ -0,0 +1,5 @@
const withTM = require('next-transpile-modules')(['ramda']);
module.exports = withTM({
/* Your Next.js config */
});

View file

@ -85,6 +85,7 @@
"craco-alias": "^2.3.1", "craco-alias": "^2.3.1",
"husky": "^7.0.4", "husky": "^7.0.4",
"lint-staged": "^12.1.6", "lint-staged": "^12.1.6",
"next-transpile-modules": "^9.0.0",
"prettier": "^1.18.2" "prettier": "^1.18.2"
}, },
"lint-staged": { "lint-staged": {

View file

@ -9,6 +9,10 @@ interface IProps {
} }
const SidebarRouter: FC<IProps> = ({ prefix = '', isLab }) => { const SidebarRouter: FC<IProps> = ({ prefix = '', isLab }) => {
if (typeof document === 'undefined') {
return null;
}
return createPortal( return createPortal(
<Authorized> <Authorized>
<SubmitBar isLab={isLab} /> <SubmitBar isLab={isLab} />

View file

@ -4448,7 +4448,7 @@ encoding@0.1.13:
dependencies: dependencies:
iconv-lite "^0.6.2" iconv-lite "^0.6.2"
enhanced-resolve@^5.8.3: enhanced-resolve@^5.7.0, enhanced-resolve@^5.8.3:
version "5.8.3" version "5.8.3"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0"
integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==
@ -7307,6 +7307,14 @@ neo-async@^2.6.2:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
next-transpile-modules@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/next-transpile-modules/-/next-transpile-modules-9.0.0.tgz#133b1742af082e61cc76b02a0f12ffd40ce2bf90"
integrity sha512-VCNFOazIAnXn1hvgYYSTYMnoWgKgwlYh4lm1pKbSfiB3kj5ZYLcKVhfh3jkPOg1cnd9DP+pte9yCUocdPEUBTQ==
dependencies:
enhanced-resolve "^5.7.0"
escalade "^3.1.1"
next@^12.0.7: next@^12.0.7:
version "12.0.7" version "12.0.7"
resolved "https://registry.yarnpkg.com/next/-/next-12.0.7.tgz#33ebf229b81b06e583ab5ae7613cffe1ca2103fc" resolved "https://registry.yarnpkg.com/next/-/next-12.0.7.tgz#33ebf229b81b06e583ab5ae7613cffe1ca2103fc"