Closed pabloapast closed 1 year ago
Hi @pabloapast, I've got specific notes about it in the readme
, and this [closed] issue https://github.com/whythawk/full-stack-fastapi-postgresql/issues/9
As far as I can tell, the script which nuxt start
should run calls node_modules/nuxt/bin/nuxt.mjs dev
... this is supposed to be in the path, but seems not to be when running docker-compose.override.yml.
Meaning, when you run the development frontend
it fails with the errors you raise.
I have tried to find how this happens, but have hit a brick wall. It's something to do with docker-compose
, node
or nuxt
, but I'm really not experienced enough with any of these to track it down.
There have been a lot of Nuxt 3.0 bugfixes, and I'll pull it up to the latest version and see if that helps. Other than that, maybe this helps someone figure it out?
Alternatively, do as suggested in the readme
:
NOTE: I find that the Nuxt container does not run well in development mode, and does not refresh on changes. In particular, nuxt/content is very unpredictable in dev mode running in the container. It is far better to run the frontend outside of the container to take advantage of live refresh.
Change into the /frontend folder, and:
yarn install yarn dev
Just note that you'll use http://localhost:3000 and not http://localhost to reach it, although the api will still be at the backend http://localhost/api/v1.
And, closest I can get to a semi-generalised solution is this: https://stackoverflow.com/questions/68581567/sh-1-nuxt-not-found-heroku-nuxt
Update package.json
:
"scripts": {
"dev": "node_modules/nuxt/bin/nuxt.mjs nuxt dev -c ./nuxt.config.ts",
"build": "node_modules/nuxt/bin/nuxt.mjs build -c ./nuxt.config.ts",
"start": "node_modules/nuxt/bin/nuxt.mjs start -c ./nuxt.config.ts",
"generate": "nuxt generate",
},
And variations ... and the "variations" is the trouble. This doesn't appear generalisable.
Release 0.7.1 should fix this.
For reference: https://stackoverflow.com/a/32785014
When docker builds the image, the node_modules directory is created within the worker directory, and all the dependencies are installed there. Then on runtime the worker directory from outside docker is mounted into the docker instance (which does not have the installed node_modules), hiding the node_modules you just installed. You can verify this by removing the mounted volume from your docker-compose.yml.
Hi! I'm having issues running the frontend service with the following error during
docker-compose up -d
:Any idea about what's happening here?