Dockerized Nuxt3 with Bun Cannot find module "@vue/reactivity"
Ive been trying to resolve this issue for the past 5+ hours. And I tracked it far enough to be sure that this is Buns fault.
Running all this with node throws no errors.
I am trying to Dockerize my Nuxt app and run it with the latest version of bun. On page load I get the following error.
This specifically only happens when I run Nuxt as dev. Production works fine. Why docker for dev environment? Ease of development as this repo has many other puzzles.
I cannot find anything online about this.
Here is my Dockerfile:
13 Replies
Another interesting detail is this:
This gets only thrown at the same time I experience this issue. Defining baseUrl inside of my tsconfig does not help.
Can you try this with 3.11? I've seen a lot of people reporting issus with modules from 3.12
Okay I tried 3.10 and 3.11, the issue persists.
I want to add, that the issue is unlikely to have arrived from my own doing, as
from "/usr/src/app/@vue/runtime-core"
gets mentioned, right? I have installed some modules which definitely use vues reactivity, but its all @nuxt modules.Cool. Checking 3.11 was a good thing to do, since there seemed to be some issues with 3.12, so we can eliminate 3.12 as the source of the problem
Do you want to recreate this issue? It should be pretty simple, just create a new Nuxt3 template with bunx and dockerize it with my Dockerfile
In case it works on your system, I will look over my package.json and find the troublemaker
I'm probalby not the best person to help you with that part. I don't use Docker very much
Do doing diagnosis on your config would be tough 😛
Yeah :sadcatangry:
I found the cause of this issue.
It was this node_module: https://github.com/modernice/vue-i18n-modules
The issue happens in the file "./packages/vue-i18n-modules/src/extension.ts" at line 1 and 2.
Any ideas why this only happens to Bun when ran in Docker?
GitHub
GitHub - modernice/vue-i18n-modules: Lazy-loaded, namespaced messag...
Lazy-loaded, namespaced messages for vue-i18n. Contribute to modernice/vue-i18n-modules development by creating an account on GitHub.
It's a nuxt module for lazy loading i18n modules. It uses it's vue package, thats where the following code is:
so you're using bun over node? just curious, if you use node, does this still happen?
It does not, nodeJS works fine.
seems that you're not the only one https://github.com/oven-sh/bun/issues/3771
and also https://github.com/oven-sh/bun/issues/4743
idk if they're experiecing the same module issue, but it definitely looks like there was issues with nuxt + bun for a minute...
also just curious, but what if you created a "temp directory"? Just thinking that instead of overriding your parent directory, you could use a temp one (e.g. /temp/dev)
and then you'd update
This issue got solved, I needed to uninstall @modernice/nuxt-i18n-modules library.