与nuxt-i18n一起使用

发布于 2025-02-07 10:28:46 字数 1509 浏览 0 评论 0原文

Hello Stack Overflow社区。在NUXT上启动项目时,我遇到了一个问题。致命的NUXT构建错误。目前,我在编程方面并不是很强大,并且与服务器上的路由相关的错误,您能帮我解决这个问题吗?

这是NUXT丢下的错误的主体。

ERROR in ./.nuxt/nuxt-i18n/plugin.routing.js 222:47
Module parse failed: Unexpected token (222:47)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|       localeLocation: this.localeLocation,
|       // @ts-ignore
>       req: process.server ? this.$root.context?.req || this.$ssrContext?.req : null,
|       route: this.$route,
|       router: this.$router,
 @ ./.nuxt/index.js 17:0-84 259:13-47 260:10-44
 @ ./.nuxt/client.js
 @ multi ./.nuxt/client.js

它还告诉我如何理解错误发生的包裹。

 FATAL  Nuxt build error                                                                                                                                                                  

  at WebpackBundler.webpackCompile (node_modules\@nuxt\webpack\dist\webpack.js:2127:21)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async WebpackBundler.build (node_modules\@nuxt\webpack\dist\webpack.js:2076:5)
  at async Builder.build (node_modules\@nuxt\builder\dist\builder.js:327:5)
  at async Object.run (node_modules\@nuxt\cli\dist\cli-build.js:110:7)
  at async NuxtCommand.run (node_modules\@nuxt\cli\dist\cli-index.js:413:7)

我真的没有和我需要做的事情。我尝试使用delete .nuxt,或在node_module中删除文件,但没有帮助。

Hello Stack Overflow community. I ran into a problem when starting a project on nuxt. FATAL Nuxt build error. At the moment I am not very strong in programming and errors related to routing on the server, could you help me with this problem?

This is the body of the error that Nuxt throws.

ERROR in ./.nuxt/nuxt-i18n/plugin.routing.js 222:47
Module parse failed: Unexpected token (222:47)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|       localeLocation: this.localeLocation,
|       // @ts-ignore
>       req: process.server ? this.$root.context?.req || this.$ssrContext?.req : null,
|       route: this.$route,
|       router: this.$router,
 @ ./.nuxt/index.js 17:0-84 259:13-47 260:10-44
 @ ./.nuxt/client.js
 @ multi ./.nuxt/client.js

It also tells me how I understood in which packages the error occurred.

 FATAL  Nuxt build error                                                                                                                                                                  

  at WebpackBundler.webpackCompile (node_modules\@nuxt\webpack\dist\webpack.js:2127:21)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async WebpackBundler.build (node_modules\@nuxt\webpack\dist\webpack.js:2076:5)
  at async Builder.build (node_modules\@nuxt\builder\dist\builder.js:327:5)
  at async Object.run (node_modules\@nuxt\cli\dist\cli-build.js:110:7)
  at async NuxtCommand.run (node_modules\@nuxt\cli\dist\cli-index.js:413:7)

I really dont anderstand what i need to do. I try delete .nuxt, or delete file in node_module, but it doesnt help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夢归不見 2025-02-14 10:28:46

这似乎与此处描述的问题相同:

看一下您的预校配置,并确保在再次运行构建之前,请确保拥有适当的加载程序。

This seems to be the same issue as the one described here:

Take a look at your Babel configuration, and make sure you have the proper loaders before running the build again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文