Closed fzaninotto closed 1 year ago
Found the problem: Remix forces a version of react-router and yarn doesn't properly deduplicate it, leading to react-admin not properly detecting that it runs inside a Remix' router.
The solution is to force a resolutions
in packages.json
:
{
// ...
"resolutions": {
"react-router": "6.8.1",
"react-router-dom": "6.8.1"
}
}
I'll update the tutorial accordingly.
NextJS also gives the exact same error when following the tutorial on appRouter, has anyone else confirmed the same problem?
- wait compiling...
- event compiled client and server successfully in 1162 ms (4887 modules)
- error node_modules/history/umd/history.development.js (328:0) @ createHashHistory
- error ReferenceError: document is not defined
null
https://marmelab.com/react-admin/NextJs.html#nextjs-with-app-router
@antennix can you also add if you are using yarn or npm, and the version?
@slax57 Me too NextJS also gives the exact same error when following the tutorial on appRouter, The version in use is as this:
/app # yarn workspace web list --depth=0
yarn workspace v1.22.19
yarn list v1.22.19
├─ @aashutoshrathi/word-wrap@1.2.6
├─ @ampproject/remapping@2.2.1
├─ @angular-devkit/core@16.1.3
├─ @angular-devkit/schematics-cli@16.1.3
├─ @angular-devkit/schematics@16.1.3
├─ @babel/code-frame@7.21.4
├─ @babel/compat-data@7.21.7
├─ @babel/core@7.21.8
├─ @babel/generator@7.22.5
├─ @babel/helper-compilation-targets@7.21.5
├─ @babel/helper-environment-visitor@7.21.5
├─ @babel/helper-function-name@7.21.0
├─ @babel/helper-hoist-variables@7.18.6
├─ @babel/helper-module-imports@7.22.5
├─ @babel/helper-module-transforms@7.21.5
├─ @babel/helper-plugin-utils@7.21.5
├─ @babel/helper-simple-access@7.21.5
├─ @babel/helper-split-export-declaration@7.18.6
├─ @babel/helper-string-parser@7.21.5
├─ @babel/helper-validator-identifier@7.19.1
├─ @babel/helper-validator-option@7.21.0
├─ @babel/helpers@7.21.5
├─ @babel/highlight@7.18.6
├─ @babel/parser@7.21.8
├─ @babel/plugin-syntax-async-generators@7.8.4
├─ @babel/plugin-syntax-bigint@7.8.3
├─ @babel/plugin-syntax-class-properties@7.12.13
├─ @babel/plugin-syntax-import-meta@7.10.4
├─ @babel/plugin-syntax-json-strings@7.8.3
├─ @babel/plugin-syntax-jsx@7.22.5
├─ @babel/plugin-syntax-logical-assignment-operators@7.10.4
├─ @babel/plugin-syntax-nullish-coalescing-operator@7.8.3
├─ @babel/plugin-syntax-numeric-separator@7.10.4
├─ @babel/plugin-syntax-object-rest-spread@7.8.3
├─ @babel/plugin-syntax-optional-catch-binding@7.8.3
├─ @babel/plugin-syntax-optional-chaining@7.8.3
├─ @babel/plugin-syntax-top-level-await@7.14.5
├─ @babel/plugin-syntax-typescript@7.22.5
├─ @babel/runtime@7.22.5
├─ @babel/template@7.20.7
├─ @babel/traverse@7.21.5
├─ @babel/types@7.21.5
├─ @bcoe/v8-coverage@0.2.3
├─ @cnakazawa/watch@1.0.4
├─ @colors/colors@1.5.0
├─ @cspotcode/source-map-support@0.8.1
├─ @emotion/babel-plugin@11.11.0
├─ @emotion/cache@11.11.0
├─ @emotion/hash@0.9.1
├─ @emotion/is-prop-valid@1.2.1
├─ @emotion/memoize@0.8.1
├─ @emotion/react@11.11.1
├─ @emotion/serialize@1.1.2
├─ @emotion/sheet@1.2.2
├─ @emotion/styled@11.11.0
├─ @emotion/unitless@0.8.1
├─ @emotion/use-insertion-effect-with-fallbacks@1.0.1
├─ @emotion/utils@1.2.1
├─ @emotion/weak-memoize@0.3.1
├─ @esbuild-kit/cjs-loader@2.4.2
├─ @esbuild-kit/core-utils@3.1.0
├─ @esbuild-kit/esm-loader@2.5.5
├─ @esbuild/android-arm@0.17.19
├─ @esbuild/android-arm64@0.17.19
├─ @esbuild/android-x64@0.17.19
├─ @esbuild/darwin-arm64@0.17.19
├─ @esbuild/darwin-x64@0.17.19
├─ @esbuild/freebsd-arm64@0.17.19
├─ @esbuild/freebsd-x64@0.17.19
├─ @esbuild/linux-arm@0.17.19
├─ @esbuild/linux-arm64@0.17.19
├─ @esbuild/linux-ia32@0.17.19
├─ @esbuild/linux-loong64@0.14.54
├─ @esbuild/linux-mips64el@0.17.19
├─ @esbuild/linux-ppc64@0.17.19
├─ @esbuild/linux-riscv64@0.17.19
├─ @esbuild/linux-s390x@0.17.19
├─ @esbuild/linux-x64@0.17.19
├─ @esbuild/netbsd-x64@0.17.19
├─ @esbuild/openbsd-x64@0.17.19
├─ @esbuild/sunos-x64@0.17.19
├─ @esbuild/win32-arm64@0.17.19
├─ @esbuild/win32-ia32@0.17.19
├─ @esbuild/win32-x64@0.17.19
├─ @eslint-community/eslint-utils@4.4.0
├─ @eslint-community/regexpp@4.5.1
├─ @eslint/eslintrc@0.4.3
├─ @eslint/js@8.44.0
├─ @humanwhocodes/config-array@0.5.0
├─ @humanwhocodes/module-importer@1.0.1
├─ @humanwhocodes/object-schema@1.2.1
├─ @istanbuljs/load-nyc-config@1.1.0
├─ @istanbuljs/schema@0.1.3
├─ @jest/console@26.6.2
├─ @jest/core@26.6.3
├─ @jest/environment@26.6.2
├─ @jest/expect-utils@29.5.0
├─ @jest/expect@29.5.0
├─ @jest/fake-timers@26.6.2
├─ @jest/globals@26.6.2
├─ @jest/reporters@26.6.2
├─ @jest/schemas@29.4.3
├─ @jest/source-map@26.6.2
├─ @jest/test-result@26.6.2
├─ @jest/test-sequencer@26.6.3
├─ @jest/transform@29.5.0
├─ @jest/types@26.6.2
├─ @jridgewell/gen-mapping@0.3.3
├─ @jridgewell/resolve-uri@3.1.0
├─ @jridgewell/set-array@1.1.2
├─ @jridgewell/source-map@0.3.4
├─ @jridgewell/sourcemap-codec@1.4.15
├─ @jridgewell/trace-mapping@0.3.18
├─ @lukeed/csprng@1.1.0
├─ @mui/base@5.0.0-beta.5
├─ @mui/core-downloads-tracker@5.13.4
├─ @mui/icons-material@5.11.16
├─ @mui/material@5.13.6
├─ @mui/private-theming@5.13.1
├─ @mui/styled-engine@5.13.2
├─ @mui/system@5.13.6
├─ @mui/types@7.2.4
├─ @mui/utils@5.13.6
├─ @nestjs/cli@10.1.0
├─ @nestjs/common@10.0.4
├─ @nestjs/core@10.0.4
├─ @nestjs/platform-express@10.0.4
├─ @nestjs/schematics@10.0.1
├─ @nestjs/testing@10.0.4
├─ @next/env@13.4.1
├─ @next/eslint-plugin-next@13.4.1
├─ @next/swc-darwin-arm64@13.4.1
├─ @next/swc-darwin-x64@13.4.1
├─ @next/swc-linux-arm64-gnu@13.4.1
├─ @next/swc-linux-arm64-musl@13.4.1
├─ @next/swc-linux-x64-gnu@13.4.1
├─ @next/swc-linux-x64-musl@13.4.1
├─ @next/swc-win32-arm64-msvc@13.4.1
├─ @next/swc-win32-ia32-msvc@13.4.1
├─ @next/swc-win32-x64-msvc@13.4.1
├─ @nodelib/fs.scandir@2.1.5
├─ @nodelib/fs.stat@2.0.5
├─ @nodelib/fs.walk@1.2.8
├─ @nuxtjs/opencollective@0.3.2
├─ @pkgr/utils@2.4.0
├─ @popperjs/core@2.11.8
├─ @prisma/client@4.16.2
├─ @prisma/engines-version@4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81
├─ @prisma/engines@4.16.2
├─ @remix-run/router@1.7.1
├─ @rushstack/eslint-patch@1.2.0
├─ @sinclair/typebox@0.25.24
├─ @sinonjs/commons@1.8.6
├─ @sinonjs/fake-timers@6.0.1
├─ @swc/helpers@0.5.1
├─ @tootallnate/once@1.1.2
├─ @tsconfig/node10@1.0.9
├─ @tsconfig/node12@1.0.11
├─ @tsconfig/node14@1.0.3
├─ @tsconfig/node16@1.0.4
├─ @types/babel__core@7.20.0
├─ @types/babel__generator@7.6.4
├─ @types/babel__template@7.4.1
├─ @types/babel__traverse@7.18.5
├─ @types/body-parser@1.19.2
├─ @types/connect@3.4.35
├─ @types/cookiejar@2.1.2
├─ @types/eslint-scope@3.7.4
├─ @types/eslint@8.40.2
├─ @types/estree@1.0.1
├─ @types/express-serve-static-core@4.17.34
├─ @types/express@4.17.17
├─ @types/graceful-fs@4.1.6
├─ @types/istanbul-lib-coverage@2.0.4
├─ @types/istanbul-lib-report@3.0.0
├─ @types/istanbul-reports@3.0.1
├─ @types/jest@26.0.24
├─ @types/json-schema@7.0.12
├─ @types/json5@0.0.29
├─ @types/mime@3.0.1
├─ @types/node@20.1.0
├─ @types/normalize-package-data@2.4.1
├─ @types/parse-json@4.0.0
├─ @types/prettier@2.7.3
├─ @types/prop-types@15.7.5
├─ @types/qs@6.9.7
├─ @types/range-parser@1.2.4
├─ @types/react-dom@17.0.20
├─ @types/react-is@18.2.1
├─ @types/react-transition-group@4.4.6
├─ @types/react@18.2.5
├─ @types/scheduler@0.16.3
├─ @types/semver@7.5.0
├─ @types/send@0.17.1
├─ @types/serve-static@1.15.1
├─ @types/stack-utils@2.0.1
├─ @types/superagent@4.1.17
├─ @types/supertest@2.0.12
├─ @types/yargs-parser@21.0.0
├─ @types/yargs@15.0.15
├─ @typescript-eslint/eslint-plugin@5.60.1
├─ @typescript-eslint/parser@5.60.1
├─ @typescript-eslint/scope-manager@5.60.1
├─ @typescript-eslint/type-utils@5.60.1
├─ @typescript-eslint/types@5.60.1
├─ @typescript-eslint/typescript-estree@5.60.1
├─ @typescript-eslint/utils@5.60.1
├─ @typescript-eslint/visitor-keys@5.59.2
├─ @webassemblyjs/ast@1.11.6
├─ @webassemblyjs/floating-point-hex-parser@1.11.6
├─ @webassemblyjs/helper-api-error@1.11.6
├─ @webassemblyjs/helper-buffer@1.11.6
├─ @webassemblyjs/helper-numbers@1.11.6
├─ @webassemblyjs/helper-wasm-bytecode@1.11.6
├─ @webassemblyjs/helper-wasm-section@1.11.6
├─ @webassemblyjs/ieee754@1.11.6
├─ @webassemblyjs/leb128@1.11.6
├─ @webassemblyjs/utf8@1.11.6
├─ @webassemblyjs/wasm-edit@1.11.6
├─ @webassemblyjs/wasm-gen@1.11.6
├─ @webassemblyjs/wasm-opt@1.11.6
├─ @webassemblyjs/wasm-parser@1.11.6
├─ @webassemblyjs/wast-printer@1.11.6
├─ @xtuc/ieee754@1.2.0
├─ @xtuc/long@4.2.2
├─ abab@2.0.6
├─ accepts@1.3.8
├─ acorn-globals@6.0.0
├─ acorn-import-assertions@1.9.0
├─ acorn-jsx@5.3.2
├─ acorn-walk@8.2.0
├─ acorn@8.9.0
├─ agent-base@6.0.2
├─ ajv-formats@2.1.1
├─ ajv-keywords@3.5.2
├─ ajv@6.12.6
├─ ansi-colors@4.1.3
├─ ansi-escapes@4.3.2
├─ ansi-regex@5.0.1
├─ ansi-styles@4.3.0
├─ any-promise@1.3.0
├─ anymatch@3.1.3
├─ api@0.0.1
├─ append-field@1.0.0
├─ arg@4.1.3
├─ argparse@1.0.10
├─ aria-query@5.1.3
├─ arr-diff@4.0.0
├─ arr-flatten@1.1.0
├─ arr-union@3.1.0
├─ array-buffer-byte-length@1.0.0
├─ array-flatten@1.1.1
├─ array-includes@3.1.6
├─ array-timsort@1.0.3
├─ array-union@2.1.0
├─ array-unique@0.3.2
├─ array.prototype.flat@1.3.1
├─ array.prototype.flatmap@1.3.1
├─ array.prototype.foreach@1.0.4
├─ array.prototype.tosorted@1.1.1
├─ asap@2.0.6
├─ assign-symbols@1.0.0
├─ ast-types-flow@0.0.7
├─ astral-regex@2.0.0
├─ asynckit@0.4.0
├─ atob@2.1.2
├─ attr-accept@2.2.2
├─ autosuggest-highlight@3.3.4
├─ available-typed-arrays@1.0.5
├─ axe-core@4.7.0
├─ axobject-query@3.1.1
├─ babel-jest@26.6.3
├─ babel-plugin-istanbul@6.1.1
├─ babel-plugin-jest-hoist@26.6.2
├─ babel-plugin-macros@3.1.0
├─ babel-preset-current-node-syntax@1.0.1
├─ babel-preset-jest@26.6.2
├─ balanced-match@1.0.2
├─ base@0.11.2
├─ base64-js@1.5.1
├─ big-integer@1.6.51
├─ binary-extensions@2.2.0
├─ bl@4.1.0
├─ body-parser@1.20.2
├─ bplist-parser@0.2.0
├─ brace-expansion@1.1.11
├─ braces@3.0.2
├─ broadcast-channel@3.7.0
├─ browser-process-hrtime@1.0.0
├─ browserslist@4.21.5
├─ bs-logger@0.2.6
├─ bser@2.1.1
├─ buffer-from@1.1.2
├─ buffer@5.7.1
├─ bundle-name@3.0.0
├─ bundle-require@3.1.2
├─ busboy@1.6.0
├─ bytes@3.1.2
├─ cac@6.7.14
├─ cache-base@1.0.1
├─ call-bind@1.0.2
├─ callsites@3.1.0
├─ camelcase@5.3.1
├─ caniuse-lite@1.0.30001482
├─ capture-exit@2.0.0
├─ chalk@4.1.2
├─ char-regex@1.0.2
├─ chardet@0.7.0
├─ chokidar@3.5.3
├─ chrome-trace-event@1.0.3
├─ ci-info@3.8.0
├─ cjs-module-lexer@0.6.0
├─ class-utils@0.3.6
├─ cli-cursor@3.1.0
├─ cli-spinners@2.9.0
├─ cli-table3@0.6.3
├─ cli-width@3.0.0
├─ client-only@0.0.1
├─ cliui@6.0.0
├─ clone@1.0.4
├─ clsx@1.2.1
├─ co@4.6.0
├─ collect-v8-coverage@1.0.1
├─ collection-visit@1.0.0
├─ color-convert@2.0.1
├─ color-name@1.1.4
├─ combined-stream@1.0.8
├─ commander@4.1.1
├─ comment-json@4.2.3
├─ component-emitter@1.3.0
├─ concat-map@0.0.1
├─ concat-stream@1.6.2
├─ consola@2.15.3
├─ content-disposition@0.5.4
├─ content-type@1.0.5
├─ convert-source-map@1.9.0
├─ cookie-signature@1.0.6
├─ cookie@0.5.0
├─ cookiejar@2.1.4
├─ copy-descriptor@0.1.1
├─ core-util-is@1.0.3
├─ cors@2.8.5
├─ cosmiconfig@7.1.0
├─ create-require@1.1.1
├─ cross-spawn@7.0.3
├─ css-mediaquery@0.1.2
├─ cssom@0.4.4
├─ cssstyle@2.3.0
├─ csstype@3.1.2
├─ damerau-levenshtein@1.0.8
├─ data-urls@2.0.0
├─ database@1.0.0
├─ date-fns@2.30.0
├─ debug@4.3.4
├─ decamelize@1.2.0
├─ decimal.js@10.4.3
├─ decode-uri-component@0.2.2
├─ dedent@0.7.0
├─ deep-equal@2.2.1
├─ deep-is@0.1.4
├─ deepmerge@4.3.1
├─ default-browser-id@3.0.0
├─ default-browser@4.0.0
├─ defaults@1.0.4
├─ define-lazy-prop@3.0.0
├─ define-properties@1.2.0
├─ define-property@0.2.5
├─ delayed-stream@1.0.0
├─ depd@2.0.0
├─ destroy@1.2.0
├─ detect-newline@3.1.0
├─ detect-node@2.1.0
├─ dezalgo@1.0.4
├─ diff-sequences@26.6.2
├─ diff@4.0.2
├─ dir-glob@3.0.1
├─ doctrine@2.1.0
├─ dom-helpers@5.2.1
├─ domexception@2.0.1
├─ dompurify@2.4.5
├─ ee-first@1.1.1
├─ electron-to-chromium@1.4.385
├─ emittery@0.13.1
├─ emoji-regex@8.0.0
├─ encodeurl@1.0.2
├─ end-of-stream@1.4.4
├─ enhanced-resolve@5.15.0
├─ enquirer@2.3.6
├─ error-ex@1.3.2
├─ es-abstract@1.21.2
├─ es-array-method-boxes-properly@1.0.0
├─ es-get-iterator@1.1.3
├─ es-module-lexer@1.3.0
├─ es-set-tostringtag@2.0.1
├─ es-shim-unscopables@1.0.0
├─ es-to-primitive@1.2.1
├─ esbuild-android-64@0.14.54
├─ esbuild-android-arm64@0.14.54
├─ esbuild-darwin-64@0.14.54
├─ esbuild-darwin-arm64@0.14.54
├─ esbuild-freebsd-64@0.14.54
├─ esbuild-freebsd-arm64@0.14.54
├─ esbuild-linux-32@0.14.54
├─ esbuild-linux-64@0.14.54
├─ esbuild-linux-arm@0.14.54
├─ esbuild-linux-arm64@0.14.54
├─ esbuild-linux-mips64le@0.14.54
├─ esbuild-linux-ppc64le@0.14.54
├─ esbuild-linux-riscv64@0.14.54
├─ esbuild-linux-s390x@0.14.54
├─ esbuild-netbsd-64@0.14.54
├─ esbuild-openbsd-64@0.14.54
├─ esbuild-sunos-64@0.14.54
├─ esbuild-windows-32@0.14.54
├─ esbuild-windows-64@0.14.54
├─ esbuild-windows-arm64@0.14.54
├─ esbuild@0.14.54
├─ escalade@3.1.1
├─ escape-html@1.0.3
├─ escape-string-regexp@4.0.0
├─ escodegen@2.0.0
├─ eslint-config-custom-server@0.0.0
├─ eslint-config-custom@0.0.0
├─ eslint-config-next@13.4.1
├─ eslint-config-prettier@8.8.0
├─ eslint-config-turbo@1.9.3
├─ eslint-import-resolver-node@0.3.7
├─ eslint-import-resolver-typescript@3.5.5
├─ eslint-module-utils@2.8.0
├─ eslint-plugin-import@2.27.5
├─ eslint-plugin-jsx-a11y@6.7.1
├─ eslint-plugin-prettier@4.2.1
├─ eslint-plugin-react-hooks@4.6.0
├─ eslint-plugin-react@7.28.0
├─ eslint-plugin-turbo@1.9.3
├─ eslint-scope@5.1.1
├─ eslint-utils@2.1.0
├─ eslint-visitor-keys@3.4.1
├─ eslint@7.32.0
├─ espree@7.3.1
├─ esprima@4.0.1
├─ esquery@1.5.0
├─ esrecurse@4.3.0
├─ estraverse@5.3.0
├─ esutils@2.0.3
├─ etag@1.8.1
├─ eventemitter3@4.0.7
├─ events@3.3.0
├─ exec-sh@0.3.6
├─ execa@5.1.1
├─ exit@0.1.2
├─ expand-brackets@2.1.4
├─ expect@26.6.2
├─ express@4.18.2
├─ extend-shallow@2.0.1
├─ external-editor@3.1.0
├─ extglob@2.0.4
├─ fast-deep-equal@3.1.3
├─ fast-diff@1.3.0
├─ fast-glob@3.2.12
├─ fast-json-stable-stringify@2.1.0
├─ fast-levenshtein@2.0.6
├─ fast-safe-stringify@2.1.1
├─ fastq@1.15.0
├─ fb-watchman@2.0.2
├─ figures@3.2.0
├─ file-entry-cache@6.0.1
├─ file-selector@0.5.0
├─ fill-range@7.0.1
├─ filter-obj@1.1.0
├─ finalhandler@1.2.0
├─ find-root@1.1.0
├─ find-up@4.1.0
├─ flat-cache@3.0.4
├─ flatted@3.2.7
├─ for-each@0.3.3
├─ for-in@1.0.2
├─ fork-ts-checker-webpack-plugin@8.0.0
├─ form-data@3.0.1
├─ formidable@2.1.2
├─ forwarded@0.2.0
├─ fragment-cache@0.2.1
├─ fresh@0.5.2
├─ fs-extra@10.1.0
├─ fs-monkey@1.0.4
├─ fs.realpath@1.0.0
├─ fsevents@2.3.2
├─ function-bind@1.1.1
├─ function.prototype.name@1.1.5
├─ functional-red-black-tree@1.0.1
├─ functions-have-names@1.2.3
├─ gensync@1.0.0-beta.2
├─ get-caller-file@2.0.5
├─ get-intrinsic@1.2.0
├─ get-package-type@0.1.0
├─ get-stream@6.0.1
├─ get-symbol-description@1.0.0
├─ get-tsconfig@4.6.2
├─ get-value@2.0.6
├─ glob-parent@5.1.2
├─ glob-to-regexp@0.4.1
├─ glob@7.2.3
├─ globals@13.20.0
├─ globalthis@1.0.3
├─ globby@11.1.0
├─ gopd@1.0.1
├─ graceful-fs@4.2.11
├─ grapheme-splitter@1.0.4
├─ graphemer@1.4.0
├─ growly@1.3.0
├─ has-bigints@1.0.2
├─ has-flag@4.0.0
├─ has-own-prop@2.0.0
├─ has-property-descriptors@1.0.0
├─ has-proto@1.0.1
├─ has-symbols@1.0.3
├─ has-tostringtag@1.0.0
├─ has-value@1.0.0
├─ has@1.0.3
├─ hexoid@1.0.0
├─ history@5.3.0
├─ hoist-non-react-statics@3.3.2
├─ hosted-git-info@2.8.9
├─ hotscript@1.0.12
├─ html-encoding-sniffer@2.0.1
├─ html-escaper@2.0.2
├─ http-errors@2.0.0
├─ http-proxy-agent@4.0.1
├─ https-proxy-agent@5.0.1
├─ human-signals@2.1.0
├─ iconv-lite@0.4.24
├─ ieee754@1.2.1
├─ ignore@5.2.4
├─ import-fresh@3.3.0
├─ import-local@3.1.0
├─ imurmurhash@0.1.4
├─ inflection@1.12.0
├─ inflight@1.0.6
├─ inherits@2.0.4
├─ inquirer@8.2.5
├─ internal-slot@1.0.5
├─ interpret@1.4.0
├─ ipaddr.js@1.9.1
├─ is-accessor-descriptor@1.0.0
├─ is-arguments@1.1.1
├─ is-array-buffer@3.0.2
├─ is-arrayish@0.2.1
├─ is-bigint@1.0.4
├─ is-binary-path@2.1.0
├─ is-boolean-object@1.1.2
├─ is-buffer@1.1.6
├─ is-callable@1.2.7
├─ is-ci@2.0.0
├─ is-core-module@2.12.0
├─ is-data-descriptor@1.0.0
├─ is-date-object@1.0.5
├─ is-descriptor@1.0.2
├─ is-docker@2.2.1
├─ is-extendable@0.1.1
├─ is-extglob@2.1.1
├─ is-fullwidth-code-point@3.0.0
├─ is-generator-fn@2.1.0
├─ is-glob@4.0.3
├─ is-inside-container@1.0.0
├─ is-interactive@1.0.0
├─ is-map@2.0.2
├─ is-negative-zero@2.0.2
├─ is-number-object@1.0.7
├─ is-number@3.0.0
├─ is-path-inside@3.0.3
├─ is-plain-object@2.0.4
├─ is-potential-custom-element-name@1.0.1
├─ is-regex@1.1.4
├─ is-set@2.0.2
├─ is-shared-array-buffer@1.0.2
├─ is-stream@2.0.1
├─ is-string@1.0.7
├─ is-symbol@1.0.4
├─ is-typed-array@1.1.10
├─ is-typedarray@1.0.0
├─ is-unicode-supported@0.1.0
├─ is-weakmap@2.0.1
├─ is-weakref@1.0.2
├─ is-weakset@2.0.2
├─ is-windows@1.0.2
├─ is-wsl@2.2.0
├─ isarray@1.0.0
├─ isexe@2.0.0
├─ isobject@3.0.1
├─ istanbul-lib-coverage@3.2.0
├─ istanbul-lib-instrument@5.2.1
├─ istanbul-lib-report@3.0.0
├─ istanbul-lib-source-maps@4.0.1
├─ istanbul-reports@3.1.5
├─ iterare@1.2.1
├─ jest-changed-files@26.6.2
├─ jest-circus@29.5.0
├─ jest-cli@26.6.3
├─ jest-config@26.6.3
├─ jest-diff@26.6.2
├─ jest-docblock@26.0.0
├─ jest-each@26.6.2
├─ jest-environment-jsdom@26.6.2
├─ jest-environment-node@29.5.0
├─ jest-get-type@29.4.3
├─ jest-haste-map@26.6.2
├─ jest-jasmine2@26.6.3
├─ jest-leak-detector@26.6.2
├─ jest-matcher-utils@26.6.2
├─ jest-message-util@29.5.0
├─ jest-mock@26.6.2
├─ jest-pnp-resolver@1.2.3
├─ jest-presets@0.0.0
├─ jest-regex-util@26.0.0
├─ jest-resolve-dependencies@26.6.3
├─ jest-resolve@26.6.2
├─ jest-runner@26.6.3
├─ jest-runtime@26.6.3
├─ jest-serializer@26.6.2
├─ jest-snapshot@29.5.0
├─ jest-util@29.5.0
├─ jest-validate@26.6.2
├─ jest-watcher@29.5.0
├─ jest-worker@26.6.2
├─ jest@26.6.3
├─ joycon@3.1.1
├─ js-sha3@0.8.0
├─ js-tokens@4.0.0
├─ js-yaml@3.14.1
├─ jsdom@16.7.0
├─ jsesc@2.5.2
├─ json-parse-even-better-errors@2.3.1
├─ json-schema-traverse@0.4.1
├─ json-stable-stringify-without-jsonify@1.0.1
├─ json5@2.2.3
├─ jsonc-parser@3.2.0
├─ jsonexport@3.2.0
├─ jsonfile@6.1.0
├─ jsx-ast-utils@3.3.3
├─ kind-of@3.2.2
├─ kleur@3.0.3
├─ language-subtag-registry@0.3.22
├─ language-tags@1.0.5
├─ leven@3.1.0
├─ levn@0.4.1
├─ lilconfig@2.1.0
├─ lines-and-columns@1.2.4
├─ load-tsconfig@0.2.5
├─ loader-runner@4.3.0
├─ locate-path@5.0.0
├─ lodash.memoize@4.1.2
├─ lodash.merge@4.6.2
├─ lodash.sortby@4.7.0
├─ lodash.truncate@4.4.2
├─ lodash@4.17.21
├─ log-symbols@4.1.0
├─ logger@0.0.0
├─ loose-envify@1.4.0
├─ lru-cache@5.1.1
├─ macos-release@2.5.1
├─ magic-string@0.30.0
├─ make-dir@3.1.0
├─ make-error@1.3.6
├─ makeerror@1.0.12
├─ map-cache@0.2.2
├─ map-visit@1.0.0
├─ match-sorter@6.3.1
├─ media-typer@0.3.0
├─ memfs@3.6.0
├─ merge-descriptors@1.0.1
├─ merge-stream@2.0.0
├─ merge2@1.4.1
├─ methods@1.1.2
├─ micromatch@4.0.5
├─ microseconds@0.2.0
├─ mime-db@1.52.0
├─ mime-types@2.1.35
├─ mime@2.6.0
├─ mimic-fn@2.1.0
├─ minimatch@3.1.2
├─ minimist@1.2.8
├─ minipass@4.2.8
├─ mixin-deep@1.3.2
├─ mkdirp@1.0.4
├─ ms@2.1.3
├─ multer@1.4.4-lts.1
├─ mute-stream@0.0.8
├─ mz@2.7.0
├─ nano-time@1.0.0
├─ nanoid@3.3.6
├─ nanomatch@1.2.13
├─ natural-compare-lite@1.4.0
├─ natural-compare@1.4.0
├─ negotiator@0.6.3
├─ neo-async@2.6.2
├─ next@13.4.1
├─ nice-try@1.0.5
├─ node-abort-controller@3.1.1
├─ node-emoji@1.11.0
├─ node-fetch@2.6.12
├─ node-int64@0.4.0
├─ node-notifier@8.0.2
├─ node-polyglot@2.5.0
├─ node-releases@2.0.10
├─ normalize-package-data@2.5.0
├─ normalize-path@3.0.0
├─ npm-run-path@4.0.1
├─ nwsapi@2.2.4
├─ object-assign@4.1.1
├─ object-copy@0.1.0
├─ object-inspect@1.12.3
├─ object-is@1.1.5
├─ object-keys@1.1.1
├─ object-visit@1.0.1
├─ object.assign@4.1.4
├─ object.entries@1.1.6
├─ object.fromentries@2.0.6
├─ object.hasown@1.1.2
├─ object.pick@1.3.0
├─ object.values@1.1.6
├─ oblivious-set@1.0.0
├─ on-finished@2.4.1
├─ once@1.4.0
├─ onetime@5.1.2
├─ open@9.1.0
├─ optionator@0.9.1
├─ ora@5.4.1
├─ os-name@4.0.1
├─ os-tmpdir@1.0.2
├─ p-each-series@2.2.0
├─ p-finally@1.0.0
├─ p-limit@3.1.0
├─ p-locate@4.1.0
├─ p-try@2.2.0
├─ parent-module@1.0.1
├─ parse-json@5.2.0
├─ parse5@6.0.1
├─ parseurl@1.3.3
├─ pascalcase@0.1.1
├─ path-exists@4.0.0
├─ path-is-absolute@1.0.1
├─ path-key@2.0.1
├─ path-parse@1.0.7
├─ path-scurry@1.10.0
├─ path-to-regexp@3.2.0
├─ path-type@4.0.0
├─ picocolors@1.0.0
├─ picomatch@2.3.1
├─ pirates@4.0.5
├─ pkg-dir@4.2.0
├─ pluralize@8.0.0
├─ posix-character-classes@0.1.1
├─ postcss-load-config@3.1.4
├─ postcss@8.4.14
├─ prelude-ls@1.2.1
├─ prettier-linter-helpers@1.0.0
├─ prettier@2.8.8
├─ pretty-format@29.5.0
├─ prisma@4.16.2
├─ process-nextick-args@2.0.1
├─ progress@2.0.3
├─ prompts@2.4.2
├─ prop-types@15.8.1
├─ proxy-addr@2.0.7
├─ psl@1.9.0
├─ pump@3.0.0
├─ punycode@2.3.0
├─ pure-rand@6.0.2
├─ qs@6.11.0
├─ query-string@7.1.3
├─ querystringify@2.2.0
├─ queue-microtask@1.2.3
├─ ra-core@4.12.0
├─ ra-data-json-server@4.11.4
├─ ra-i18n-polyglot@4.12.0
├─ ra-language-english@4.12.0
├─ ra-ui-materialui@4.12.0
├─ randombytes@2.1.0
├─ range-parser@1.2.1
├─ raw-body@2.5.2
├─ react-admin@4.12.0
├─ react-dom@18.2.0
├─ react-dropzone@12.1.0
├─ react-error-boundary@3.1.4
├─ react-hook-form@7.45.1
├─ react-is@18.2.0
├─ react-query@3.39.3
├─ react-router-dom@6.14.1
├─ react-router@6.14.1
├─ react-transition-group@4.4.5
├─ react@18.2.0
├─ read-pkg-up@7.0.1
├─ read-pkg@5.2.0
├─ readable-stream@3.6.2
├─ readdirp@3.6.0
├─ rechoir@0.6.2
├─ reflect-metadata@0.1.13
├─ regenerator-runtime@0.13.11
├─ regex-not@1.0.2
├─ regexp.prototype.flags@1.5.0
├─ regexpp@3.2.0
├─ remove-accents@0.4.2
├─ remove-trailing-separator@1.1.0
├─ repeat-element@1.1.4
├─ repeat-string@1.6.1
├─ require-directory@2.1.1
├─ require-from-string@2.0.2
├─ require-main-filename@2.0.0
├─ requires-port@1.0.0
├─ resolve-cwd@3.0.0
├─ resolve-from@5.0.0
├─ resolve-pkg-maps@1.0.0
├─ resolve-url@0.2.1
├─ resolve.exports@2.0.2
├─ resolve@1.22.2
├─ restore-cursor@3.1.0
├─ ret@0.1.15
├─ reusify@1.0.4
├─ rimraf@3.0.2
├─ rollup@2.79.1
├─ rsvp@4.8.5
├─ run-applescript@5.0.0
├─ run-async@2.4.1
├─ run-parallel@1.2.0
├─ rxjs@7.8.1
├─ safe-buffer@5.2.1
├─ safe-regex-test@1.0.0
├─ safe-regex@1.1.0
├─ safer-buffer@2.1.2
├─ sane@4.1.0
├─ saxes@5.0.1
├─ scheduler@0.23.0
├─ schema-utils@3.3.0
├─ semver@6.3.0
├─ send@0.18.0
├─ serialize-javascript@6.0.1
├─ serve-static@1.15.0
├─ set-blocking@2.0.0
├─ set-value@2.0.1
├─ setprototypeof@1.2.0
├─ shebang-command@2.0.0
├─ shebang-regex@3.0.0
├─ shelljs@0.8.5
├─ shellwords@0.1.1
├─ side-channel@1.0.4
├─ signal-exit@3.0.7
├─ sisteransi@1.0.5
├─ slash@3.0.0
├─ slice-ansi@4.0.0
├─ snapdragon-node@2.1.1
├─ snapdragon-util@3.0.1
├─ snapdragon@0.8.2
├─ source-map-js@1.0.2
├─ source-map-resolve@0.5.3
├─ source-map-support@0.5.21
├─ source-map-url@0.4.1
├─ source-map@0.6.1
├─ spdx-correct@3.2.0
├─ spdx-exceptions@2.3.0
├─ spdx-expression-parse@3.0.1
├─ spdx-license-ids@3.0.13
├─ split-on-first@1.1.0
├─ split-string@3.1.0
├─ sprintf-js@1.0.3
├─ stack-utils@2.0.6
├─ static-extend@0.1.2
├─ statuses@2.0.1
├─ stop-iteration-iterator@1.0.0
├─ streamsearch@1.1.0
├─ strict-uri-encode@2.0.0
├─ string_decoder@1.3.0
├─ string-length@4.0.2
├─ string-width@4.2.3
├─ string.prototype.matchall@4.0.8
├─ string.prototype.trim@1.2.7
├─ string.prototype.trimend@1.0.6
├─ string.prototype.trimstart@1.0.6
├─ strip-ansi@6.0.1
├─ strip-bom@3.0.0
├─ strip-eof@1.0.0
├─ strip-final-newline@2.0.0
├─ strip-json-comments@3.1.1
├─ styled-jsx@5.1.1
├─ stylis@4.2.0
├─ sucrase@3.32.0
├─ superagent@8.0.9
├─ supertest@6.3.3
├─ supports-color@7.2.0
├─ supports-hyperlinks@2.3.0
├─ supports-preserve-symlinks-flag@1.0.0
├─ symbol-observable@4.0.0
├─ symbol-tree@3.2.4
├─ synckit@0.8.5
├─ table@6.8.1
├─ tapable@2.2.1
├─ terminal-link@2.1.1
├─ terser-webpack-plugin@5.3.9
├─ terser@5.18.2
├─ test-exclude@6.0.0
├─ text-table@0.2.0
├─ thenify-all@1.6.0
├─ thenify@3.3.1
├─ throat@5.0.0
├─ through@2.3.8
├─ titleize@3.0.0
├─ tmp@0.0.33
├─ tmpl@1.0.5
├─ to-fast-properties@2.0.0
├─ to-object-path@0.3.0
├─ to-regex-range@5.0.1
├─ to-regex@3.0.2
├─ toidentifier@1.0.1
├─ tough-cookie@4.1.2
├─ tr46@2.1.0
├─ tree-kill@1.2.2
├─ ts-interface-checker@0.1.13
├─ ts-jest@26.5.6
├─ ts-loader@9.4.4
├─ ts-node@10.9.1
├─ tsconfig-paths-webpack-plugin@4.0.1
├─ tsconfig-paths@4.2.0
├─ tsconfig@0.0.0
├─ tslib@2.6.0
├─ tsup@5.12.9
├─ tsutils@3.21.0
├─ tsx@3.12.7
├─ turbo-darwin-64@1.9.3
├─ turbo-darwin-arm64@1.9.3
├─ turbo-linux-64@1.9.3
├─ turbo-linux-arm64@1.9.3
├─ turbo-windows-64@1.9.3
├─ turbo-windows-arm64@1.9.3
├─ turbo@1.9.3
├─ type-check@0.4.0
├─ type-detect@4.0.8
├─ type-fest@0.20.2
├─ type-is@1.6.18
├─ typed-array-length@1.0.4
├─ typedarray-to-buffer@3.1.5
├─ typedarray@0.0.6
├─ typescript@4.9.5
├─ ui@0.0.0
├─ unbox-primitive@1.0.2
├─ union-value@1.0.1
├─ universalify@2.0.0
├─ unload@2.2.0
├─ unpipe@1.0.0
├─ unset-value@1.0.0
├─ untildify@4.0.0
├─ update-browserslist-db@1.0.11
├─ uri-js@4.4.1
├─ urix@0.1.0
├─ url-parse@1.5.10
├─ use@3.1.1
├─ util-deprecate@1.0.2
├─ utils-merge@1.0.1
├─ uuid@8.3.2
├─ v8-compile-cache-lib@3.0.1
├─ v8-compile-cache@2.3.0
├─ v8-to-istanbul@7.1.2
├─ validate-npm-package-license@3.0.4
├─ vary@1.1.2
├─ w3c-hr-time@1.0.2
├─ w3c-xmlserializer@2.0.0
├─ walker@1.0.8
├─ warning@4.0.3
├─ watchpack@2.4.0
├─ wcwidth@1.0.1
├─ web@0.0.0
├─ webidl-conversions@6.1.0
├─ webpack-node-externals@3.0.0
├─ webpack-sources@3.2.3
├─ webpack@5.88.1
├─ whatwg-encoding@1.0.5
├─ whatwg-mimetype@2.3.0
├─ whatwg-url@8.7.0
├─ which-boxed-primitive@1.0.2
├─ which-collection@1.0.1
├─ which-module@2.0.1
├─ which-typed-array@1.1.9
├─ which@2.0.2
├─ windows-release@4.0.0
├─ word-wrap@1.2.3
├─ wrap-ansi@7.0.0
├─ wrappy@1.0.2
├─ write-file-atomic@4.0.2
├─ ws@7.5.9
├─ xml-name-validator@3.0.0
├─ xmlchars@2.2.0
├─ xtend@4.0.2
├─ y18n@4.0.3
├─ yallist@3.1.1
├─ yaml@1.10.2
├─ yargs-parser@21.1.1
├─ yargs@15.4.1
├─ yn@3.1.1
├─ yocto-queue@0.1.0
└─ zod@3.21.4
Just tried in a fresh project, and indeed I see this error in the NextJS output. However, the React Admin app seems to work just fine. @antennix @ma684351 can you confirm this is the case on your end too?
Same error for me following Next.js getting started. I'm using App Router btw.
It seems I can't reproduce the issue by following Remix tutorial V1 and V2. I have no issue with NextJS tutorial and Pages Router. However, I see the error by following NextJS tutorial with App Router, but the React Admin app works.
# in NextJS output
- error node_modules/history/umd/history.development.js (328:0) @ createHashHistory
- error ReferenceError: document is not defined
null
node -v : 20.0.0 yarn -v : 1.22.19
I'm also seeing this error (using npm, with nextjs App Router).
I have a build error that i think might be related and is preventing me from deploying my code. Does anyone have any pointers?
Error occurred prerendering page "/admin". Read more: https://nextjs.org/docs/messages/prerender-error
ReferenceError: document is not defined
at exports.modules.70998.t.createHashHistory (/Users/benjamindell/Documents/dev/heysummit-web/.next/server/chunks/183.js:100379:2856)
at /Users/benjamindell/Documents/dev/heysummit-web/.next/server/chunks/183.js:130457:109
at Object.ye [as useMemo] (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:101:241)
at exports.useMemo (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react/cjs/react.production.min.js:29:208)
at InternalRouter (/Users/benjamindell/Documents/dev/heysummit-web/.next/server/chunks/183.js:130457:44)
at Ue (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
at Z (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
at Ue (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:118:191)
at Z (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
at Ue (/Users/benjamindell/Documents/dev/heysummit-web/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:114:9)
- info Generating static pages (5/5)
> Export encountered errors on following paths:
/(backend)/admin/page: /admin
The contents of my app/admin/page.tsx is as follows:
"use client";
import { Admin, Resource, EditGuesser } from "react-admin";
import { dataProvider } from "../_providers/dataProvider";
import { UserList, UserCreate, UserEdit, UserShow } from "./_resources/User";
export default function App() {
return (
<Admin dataProvider={dataProvider}>
<Resource name="User" list={UserList} edit={EditGuesser} create={UserCreate} show={UserShow} />
</Admin>
);
}
@benjamindell Try moving the Admin component into a new file ex: components/admin/AdminApp.tsx
, and then importing it dynamically into admin/page.tsx
like so:
import { NextPage } from 'next';
import dynamic from 'next/dynamic';
const AdminApp = dynamic(() => import('@components/admin/AdminApp'), {
ssr: false,
});
const Admin: NextPage = () => <AdminApp />;
export default Admin;
I had the same build issue and this resolved it
@benjamindell Try moving the Admin component into a new file ex:
components/admin/AdminApp.tsx
, and then importing it dynamically intoadmin/page.tsx
like so:import { NextPage } from 'next'; import dynamic from 'next/dynamic'; const AdminApp = dynamic(() => import('@components/admin/AdminApp'), { ssr: false, }); const Admin: NextPage = () => <AdminApp />; export default Admin;
I had the same build issue and this resolved it
Thanks, that worked!
We've updated the nextjs tutorial in #9131, where we encourage the solution above.
Problem
Following the Remix Tutorial, after adding the two routes (index and splat) then running
yarn dev
and browsing to the served page (http://localhost:3000
), I get an errorSo I couldn't finish the step called Using React-Admin As The Root Application