Closed JohnGrime closed 2 months ago
Thank you for the report, and for trying out our viewer!
I am not sure I have all the info about your environment. Does nvm install node
give you node 18 or higher?
Also, the error message you got looks like this line is the problem:
import packageJson from "./package.json" assert { type: "json" };
It was introduced fairly recently and I'm sure we can fix it.
Hi @toloudis ,
These appear to be the node-y versions that are present inside the Apptainer environment:
Apptainer> node --version
v22.1.0
Apptainer> nvm --version
0.39.7
Apptainer> npm --version
10.7.0
Apptainer>
Thanks!
For reference, we have 2 possible suggested fixes in webpack.dev.js:
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const packageJson = require("./package.json");
or
import packageJson from "./package.json" with { type: "json" };
If you want to try locally, I suggest trying the latter one first (using with
instead of assert)
The latter approach worked - I added a strategic sed
invocation in the setup, and all was well. Thanks, @toloudis!
However, running the dev server in the resultant container had some issues. I also struggled to get it working under Ubuntu 24.04 in WSL2.
It seems to work fine under Ubuntu 24.04 in Hyper-V, and in a Docker container in Ubuntu 20.04, so I'm in pretty good shape to try this out.
Thanks for the help!
Description
Following the instructions in the "Example" section of the Volume Viewer docs does not appear to produce a working example in an Apptainer environment.
Expected Behavior
I expected the
npm run dev
command to produce a working example, as per the docs:Reproduction
Container definition file contains:
The
npm install
command appears to work as expected, but running the container and tryingnpm run dev
results in:Environment
WSL2 inside Windows 11 => Apptainer v 1.3.1 using Ubuntu 22.04 base image.