Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你的示例工程在我的环境下无法通过编译不明白是什么问题 #11

Open
AKAMKII6666 opened this issue Nov 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@AKAMKII6666
Copy link

手下那这是个非常不错的组件,于是我决定着手将它搬进我的项目里,但是我按照你的文档把它搬进去以后,出现了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')

系统:windows10
nodejs: V18.16.1

@AKAMKII6666
Copy link
Author

刚刚又去测试了一下,发现MAC可以编译,有没有可能支持windows编译或者可能是我的windows环境有问题?

@Yrobot
Copy link
Owner

Yrobot commented Nov 20, 2023

可能是windows的文件路径逻辑和linux不一样导致的 isApp的判断报错了,待修复。欢迎PR

@Yrobot Yrobot added the bug Something isn't working label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants