手下那这是个非常不错的组件,于是我决定着手将它搬进我的项目里,但是我按照你的文档把它搬进去以后,出现了TypeError: Cannot read properties of undefined (reading '_isAppDir'),所以我就尝试用你的示例工程看看是不是有什么组件的版本有区别,结果发现你的示例工程也会出现这个问题:
yarn build
yarn run v1.22.18
warning package.json: No license field
$ next build && next export -o out
info Linting and checking validity of types
warn Compiled with warnings
./node_modules/i18next-ssg/dist/esm/config.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/i18next-ssg/dist/esm/config.js
./node_modules/i18next-ssg/dist/esm/index.js
info Collecting page data
Build error occurred
TypeError: Cannot read properties of undefined (reading '_isAppDir')
at F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\export\index.js:411:39
at Array.filter ()
at F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\export\index.js:410:43
at async Span.traceAsyncFn (F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\trace\trace.js:103:20)
at async F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\build\index.js:1511:21
at async Span.traceAsyncFn (F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\trace\trace.js:103:20)
at async F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\build\index.js:1367:17
at async Span.traceAsyncFn (F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\trace\trace.js:103:20)
at async build (F:\workspace\persionalGitLib\i18next-ssg-master\node_modules\next\dist\build\index.js:145:29)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
重点是这一句 TypeError: Cannot read properties of undefined (reading '_isAppDir')
手下那这是个非常不错的组件,于是我决定着手将它搬进我的项目里,但是我按照你的文档把它搬进去以后,出现了TypeError: Cannot read properties of undefined (reading '_isAppDir'),所以我就尝试用你的示例工程看看是不是有什么组件的版本有区别,结果发现你的示例工程也会出现这个问题:
yarn build
yarn run v1.22.18 warning package.json: No license field $ next build && next export -o out
./node_modules/i18next-ssg/dist/esm/config.js Critical dependency: the request of a dependency is an expression
Import trace for requested module: ./node_modules/i18next-ssg/dist/esm/config.js ./node_modules/i18next-ssg/dist/esm/index.js
重点是这一句
TypeError: Cannot read properties of undefined (reading '_isAppDir')
系统:windows10 nodejs: V18.16.1