Comments (8)
Good morning!
Do you have an example application so we can reproduce the issue?
from unit.
Yes, we can provide it.
https://github.com/rommanio/sample-nuxt-unit-app
You can build and run it by docker compose -f docker/docker-compose.yml build && docker compose -f docker/docker-compose.yml up
.
from unit.
@javorszky please give it a try to check whats the issue. Feel free to invite other to join the research.
from unit.
I've been debugging for the past hour and a bit. I have an idea where / why it hangs, but haven't found the concrete issue yet. I'll keep everyone updated once I either get stuck and need more answers or found a resolution :)
from unit.
@rommanio we found a possible cause for this. Testing whether that's causing it and trying to fix it.
from unit.
@rommanio we found a possible cause for this. Testing whether that's causing it and trying to fix it.
Good news. Thank you! :)
from unit.
@rommanio I've opened a PR to fix this issue that I tested locally: #1020
Here's how you can test the same changesets on your end:
- copy
unit-http
into your sample repository'sdocker
folder. I had that local copy as./docker/unit-http
. This is so the local files can be copied into the dockerfile - modify the dockerfile so it looks like this:
notable changes:
FROM unit:1.31.1-node20 #COPY --chown=unit . /var/www/ RUN mkdir -p /builder COPY . /builder COPY docker/unit-http /lib/unit-http WORKDIR /builder RUN npm i --progress=false RUN npm run build RUN mkdir -p build && cp -r .output/server build/ RUN npm run generate RUN cp -r .output/public build/ RUN cp -r build /var/www/ RUN chown -R unit:unit /var/www RUN chmod +x /var/www/server/index.mjs WORKDIR /var/www/server
- removed all the npm links
- copied the local copy of unit-http from the host into
/lib/
folder inside the dockerfile - removed copying the unit.json file
- change the unit.json file's
arguments
part to this:notable changes:"arguments": [ "node", "--loader", "/lib/unit-http/loader.mjs", "--require", "/lib/unit-http/loader", "index.mjs" ],
- replaced the require and loader paths from specifying only the package name to its path on the disk:
/lib/...
- replaced the require and loader paths from specifying only the package name to its path on the disk:
- change the docker-compose.yml to add a volume mount on it:
this way the image doesn't need to be rebuilt if we're only making configuration changes
volumes: - ./unit.json:/docker-entrypoint.d/config.json
- lastly change the local copy of the
./docker/unit-http/loader.js
and./docker/unit-http/loader.mjs
files so they add the new lines that are in the pull request.
That fixed the issue for me.
from unit.
Could you please also include short description in docs/changes.xml
(for release purposes), since this change is visible for users.
Something like:
diff --git a/docs/changes.xml b/docs/changes.xml
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -40,6 +40,13 @@ with Next.js.
</para>
</change>
+<change type="bugfix">
+<para>
+Node.js module name rules, notable for Node.js Nuxt applications.
+</para>
+</change>
+
+
</changes>
from unit.
Related Issues (20)
- Badge colors don't match NGINX colors
- nginx unit php server stops responding when using supervisor HOT 2
- BUG: Environment Variables not passed to Wasm Applications HOT 4
- Error: Cannot find module 'unit-http/loader' HOT 3
- Error 503, PHP HOT 8
- [Feature Request] Basic Authentication for Control Socket HOT 3
- CLI: subcommand for saving configuration HOT 3
- CLI: deploy configuration to many instances HOT 3
- CLI: SSH Support HOT 4
- Unit is not compiled with php, njs and wasm-wasi-component HOT 5
- Node.js: Unable to run due to Server this.on is not a function HOT 4
- "Waiting for Server Response" time consistently different depending on POST DATA Length? HOT 9
- http2 on; doesnt work as expected HOT 2
- RHEL Packages: GPG check fails when explicitly enabled HOT 9
- Query control API to show the loaded modules HOT 9
- Change server name header HOT 1
- Add error code and error message as variables at error page HOT 1
- Docker: for python based images, use the -slim version HOT 13
- Building Containers for amd64 on ARM instances fails HOT 5
- Crypto HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unit.