Nomnoml service seems broken
See original GitHub issueCurrent behaviour
When I curl
the nomnoml engine I get this error:
$ curl -X POST -H 'Content-type: text/plain' -H 'Accept: svg+xml' --data-binary @tests/smoke/diagrams/pirate.nomnoml http://localhost:80
00/nomnoml/svg
Error 500: pkg/prelude/bootstrap.js:1185
throw error;
^
Error: Cannot find module 'nomnoml'
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/f
ile into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:635:17)
at Module.require (pkg/prelude/bootstrap.js:1166:31)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/snapshot/app/index.js:0:0)
at Module._compile (pkg/prelude/bootstrap.js:1261:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:710:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
(exit code 1)%
And I just noticed these warnings when I run make package
for the nomnoml builder container:
$ make package
docker build -f ops/docker/alpine/Dockerfile -t kroki-builder-nomnoml:alpine -t kroki-builder-nomnoml:latest -t kroki-builder-nomnoml:0.6.1-alpine .
Sending build context to Docker daemon 71.68kB
Step 1/9 : FROM node:10.15.0-alpine
---> 288d2f688643
Step 2/9 : RUN npm install -g pkg pkg-fetch
---> Using cache
---> 90cdd61e6d5a
Step 3/9 : ENV NODE node10
---> Using cache
---> a624dbdc66ca
Step 4/9 : ENV PLATFORM alpine
---> Using cache
---> 7c1905875633
Step 5/9 : ENV ARCH x64
---> Using cache
---> e9a231d32196
Step 6/9 : RUN /usr/local/bin/pkg-fetch ${NODE} ${PLATFORM} ${ARCH}
---> Using cache
---> 791929534cc9
Step 7/9 : COPY . /app
---> c011cda81bf6
Step 8/9 : WORKDIR /app
---> Running in 0b9d775c3015
Removing intermediate container 0b9d775c3015
---> fb232be716f8
Step 9/9 : RUN /usr/local/bin/pkg --targets ${NODE}-${PLATFORM}-${ARCH} . -o app.bin
---> Running in 7b1757ee33e6
> pkg@4.4.0
> Warning Cannot find module 'nomnoml' from '/app'
/app/index.js
> Warning Cannot find module 'nomnoml' from '/app'
/app/index.js
Removing intermediate container 7b1757ee33e6
---> 383287f6031f
Successfully built 383287f6031f
Successfully tagged kroki-builder-nomnoml:alpine
Successfully tagged kroki-builder-nomnoml:latest
Successfully tagged kroki-builder-nomnoml:0.6.1-alpine
The pkg error comes from the fact that I didn’t run npm install
in the nomnoml
directory because then theres is no node_modules
with nomnoml
if I don’t do that and it will never be in th container as it’s copied into the container.
But if I run npm install
before running make package
in the nomnoml
directory, the warning disappears but I still get the curl error I told about in the beginning. So it looks like there is a problem with nomnoml
packaging.
Desired behaviour
nomnoml
should be included in the container- The nomnoml service should answer a 200 HTTP code with a response body containing the SVG.
Host system information
$ cat /etc/*release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux
$ node --version
v12.13.0
$ npm --version
6.12.0
Thanks in advance for your help.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
nomnoml - README
nomnoml provides an R interface to nomnoml.js, a tool for drawing sassy UML diagrams based on syntax with customizable styling.
Read more >Support more diagrams in AsciiDoc and Markdown using Kroki
Use tasks to break down this issue into smaller parts. ... Wow, never even knew about kroki, what an interesting service!
Read more >Line break for components - Stack Overflow
My PlantUML code looks like this ... Is there a way to force all packages after child2 to be below (line break) the...
Read more >Simple Graphing Library with nice look and online features
I had thought that nomnoml syntax looked easy enough to work with, but I didn't realise you could define a map through a...
Read more >Suport for PlantUML - Share & showcase - Obsidian Forum
Looks like plantuml has more diagrams and the documnetation on their web page isn;t broken. ... What about Mermaid's documentation is broken?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I must have made a mistake when building/publishing the containers. I’ve just published a new version 0.0.10 and it’s working fine.
We should probably use the CI to build/publish the containers in order to avoid human errors 😉
It’s strange I still get the same error in the container:
And I get the following output when I build the container: