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

ERROR: Nuxt module should be a function: [object Object] after upgrading i18n to 9.1.0 #3246

Open
dalisys opened this issue Nov 27, 2024 · 4 comments

Comments

@dalisys
Copy link

dalisys commented Nov 27, 2024

Environment

------------------------------
- Operating System: Windows_NT
- Node Version:     v22.11.0
- Nuxt Version:     3.14.1592
- CLI Version:      3.15.0
- Nitro Version:    2.10.4
- Package Manager:  [email protected]
- Builder:          -
- User Config:      default
- Runtime Modules:  @primevue/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @vee-validate/[email protected], @nuxt/[email protected], @vueuse/[email protected], @nuxtjs/[email protected], @pinia/[email protected], @nuxt/[email protected], @nuxthub/[email protected], [email protected], [email protected]
- Build Modules:    -
------------------------------

Reproduction

Update @nuxtjs/i18n from 8.5.5 to 9.1.0
yarn install

Describe the bug

After updating i18n to 9.1.0 and do yarn install

I get the following error:

couldn't be built successfully (exit code 1, logs can be found here: C:\Users\xxx\AppData\Local\Temp\xfs-72afd679\build.log) ➤ YN0000: └ Completed in 32s 297ms ➤ YN0000: · Failed with errors in 37s 250ms

Nuxt module should be a function: [object Object]

Additional context

I am already using the Nuxt 4 folder structure

Logs

Copy link

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 Reproduction starter (v8 and higher)
👉 Reproduction starter (edge)

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

@dalisys
Copy link
Author

dalisys commented Nov 27, 2024

After many tries to provide a reproduction, I found the problem

The error occurred because I didn't have

"typescript": "^5.7.2"

in my package.json

The problem doesn't occur with 8.5.5

Reproduction: Codesandbox

@MaxenceChx
Copy link

I had the same problem. After installing the latest version of @nuxtjs/i18n (9.1.0), I got the error Nuxt module should be a function: [object Object].

After installing typescript^5.7.2, the problem was solved.

@BobbieGoede
Copy link
Collaborator

While debugging locally all I can figure out is that this issue is specific to yarn (somewhat related nuxt/nuxt#22861, see logs in the last comment).

Unfortunately #3251 has failing CI, I'll see if I can update deps and resolve it locally but I can imagine this issue will pop up again (when fixed) later as it seems to be something to do with dependency resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants