Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend server closing directly #82

Open
theogf opened this issue Aug 7, 2022 · 4 comments
Open

Frontend server closing directly #82

theogf opened this issue Aug 7, 2022 · 4 comments

Comments

@theogf
Copy link
Contributor

theogf commented Aug 7, 2022

When trying to serve the docs (from serve.jl generated with PkgTemplates) I get the following:

[ Info: Starting initial build...
[ Info: Starting frontend dev server at http://localhost:3000
[ Info: Done.
[ Info: Starting server...
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)
[ Info: Stopped frontend dev server

localhost:3000 returns nothing and 8000 shows this
image

@lorenzoh
Copy link
Owner

lorenzoh commented Sep 3, 2022

The output of npm dev is hidden by the command; this is probably throwing an error. You can try going to the Pollen.FRONTEND_DIR directory and running npm dev manually to see if an error is shown.

@sethaxen
Copy link

I just had the same error.

The output of npm dev is hidden by the command; this is probably throwing an error. You can try going to the Pollen.FRONTEND_DIR directory and running npm dev manually to see if an error is shown.

When I follow these instructions, this is the result. I'm not sure what the next step is.

$ npm run dev

> [email protected] dev
> vite dev

file:///home/sethaxen/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend/node_modules/vite/bin/vite.js:7
    await import('source-map-support').then((r) => r.default.install())
    ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)

In case it's useful, I did get some error upon the first run of servedocs:

julia> servedocs(ArviZJuliaDocs)
[ Info: Loading project configuration from /home/sethaxen/projects/ArviZJuliaDocs/docs
  Activating project at `~/projects/ArviZJuliaDocs/docs`
┌ Info: Downloading stork executable for Ubuntu 20.04. If you're using a different
└ Linux distribution, it may fail.
[ Info: Starting development server...
[ Info: Starting initial build...
[ Info: Cloning Pollen.jl frontend code from https://github.com/lorenzoh/pollenjl-frontend...
Cloning into '/home/sethaxen/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend'...
remote: Enumerating objects: 2339, done.
remote: Counting objects: 100% (432/432), done.
remote: Compressing objects: 100% (253/253), done.
remote: Total 2339 (delta 229), reused 353 (delta 168), pack-reused 1907
Receiving objects: 100% (2339/2339), 6.97 MiB | 14.87 MiB/s, done.
Resolving deltas: 100% (1627/1627), done.

Already on 'main'
Your branch is up to date with 'origin/main'.
[ Info: Installing Pollen.jl frontend dependencies...
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
[ Info: Done.......] - extract:esbuild-linux-riscv64: sill extract esbuild-linux-riscv64@0.15.11 extracted
[ Info: Starting server...
✓ LiveServer listening on http://localhost:8000/ ...d-numberformat: sill extract @formatjs/intl-unified-num
  (use CTRL+C to shut down)[            ......] - extract:@formatjs/intl-unified-numberformat: sill extract [            ......] | extract:esbuild-darwin-64: sill extract esbuild-darwin-64@0.15.11 extracted to /home
npm WARN lifecycle The node binary used for scripts is /usr/bin/node but npm is using /home/sethaxen/.julia/artifacts/6460883d771aad2be8082172187a886c663a8a80/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> esbuild@0.15.11 postinstall /home/sethaxen/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend/node_modules/esbuild
> node install.js


> svelte-preprocess@4.10.7 postinstall /home/sethaxen/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend/node_modules/svelte-preprocess
> echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc..."

[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc...

> @sveltejs/kit@1.0.0-next.516 postinstall /home/sethaxen/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend/node_modules/@sveltejs/kit
> node postinstall.js

file:///home/sethaxen/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend/node_modules/@sveltejs/kit/postinstall.js:8
	const cwd = process.env.INIT_CWD ?? process.cwd();
	                                  ^

SyntaxError: Unexpected token '?'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)
npm WARN juliadocs@0.0.1 No repository field.
npm WARN juliadocs@0.0.1 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/android-arm@0.15.11 (node_modules/@esbuild/android-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/android-arm@0.15.11: wanted {"os":"android","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-loong64@0.15.11 (node_modules/@esbuild/linux-loong64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-loong64@0.15.11: wanted {"os":"linux","arch":"loong64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-arm64@0.15.11 (node_modules/esbuild-windows-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-arm64@0.15.11: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-64@0.15.11 (node_modules/esbuild-windows-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-64@0.15.11: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-32@0.15.11 (node_modules/esbuild-windows-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-32@0.15.11: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-sunos-64@0.15.11 (node_modules/esbuild-sunos-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-sunos-64@0.15.11: wanted {"os":"sunos","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-openbsd-64@0.15.11 (node_modules/esbuild-openbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-openbsd-64@0.15.11: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-netbsd-64@0.15.11 (node_modules/esbuild-netbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-netbsd-64@0.15.11: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-s390x@0.15.11 (node_modules/esbuild-linux-s390x):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-s390x@0.15.11: wanted {"os":"linux","arch":"s390x"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-riscv64@0.15.11 (node_modules/esbuild-linux-riscv64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-riscv64@0.15.11: wanted {"os":"linux","arch":"riscv64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-ppc64le@0.15.11 (node_modules/esbuild-linux-ppc64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-ppc64le@0.15.11: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-mips64le@0.15.11 (node_modules/esbuild-linux-mips64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-mips64le@0.15.11: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm64@0.15.11 (node_modules/esbuild-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm64@0.15.11: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm@0.15.11 (node_modules/esbuild-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm@0.15.11: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-32@0.15.11 (node_modules/esbuild-linux-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-32@0.15.11: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-arm64@0.15.11 (node_modules/esbuild-freebsd-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-arm64@0.15.11: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-64@0.15.11 (node_modules/esbuild-freebsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-64@0.15.11: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-arm64@0.15.11 (node_modules/esbuild-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-arm64@0.15.11: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-64@0.15.11 (node_modules/esbuild-darwin-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-64@0.15.11: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.15.11 (node_modules/esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.15.11: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-64@0.15.11 (node_modules/esbuild-android-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-64@0.15.11: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @sveltejs/kit@1.0.0-next.516 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @sveltejs/kit@1.0.0-next.516 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sethaxen/.npm/_logs/2022-11-12T20_31_11_461Z-debug.log
^C[ Info: Shutting down server...
  Activating project at `/tmp/jl_s3Vw4c`

julia> ^C

julia> servedocs(ArviZJuliaDocs)
[ Info: Loading project configuration from /home/sethaxen/projects/ArviZJuliaDocs/docs
  Activating project at `~/projects/ArviZJuliaDocs/docs`
[ Info: Starting development server...
[ Info: Starting initial build...
[ Info: Starting frontend dev server at http://localhost:5173
[ Info: Done.
[ Info: Starting server...
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)
[ Info: Stopped frontend dev server
^C[ Info: Shutting down server...
  Activating project at `/tmp/jl_s3Vw4c`

julia> servedocs(ArviZJuliaDocs)
[ Info: Loading project configuration from /home/sethaxen/projects/ArviZJuliaDocs/docs
  Activating project at `~/projects/ArviZJuliaDocs/docs`
[ Info: Starting development server...
[ Info: Starting initial build...
[ Info: Starting frontend dev server at http://localhost:5173
[ Info: Done.
[ Info: Starting server...
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)
[ Info: Stopped frontend dev server

@theogf
Copy link
Contributor Author

theogf commented Nov 12, 2022

It's funny I was just trying running this again starting from scratch. Aaaand I still have the same issue...

This is my error though

shell> npm run dev

> [email protected] dev
> svelte-kit dev

file:///home/theo/.julia/scratchspaces/c88717ad-5130-4874-a664-5a9aba5ec443/frontend/node_modules/@sveltejs/kit/dist/cli.js:1073
                                        } else if (allow?.length && cwd) {
                                                         ^

SyntaxError: Unexpected token '.'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

@lorenzoh
Copy link
Owner

lorenzoh commented Nov 22, 2022

Seems related to node versions and untested interplay with OS. The best way to fix this on your system would be to run Pollen.servedocs with the frontend = false kwarg and then run the frontend manually.

To do that, clone it, running:

git clone https://github.com/lorenzoh/pollenjl-frontend
cd pollenjl-frontend
npm install
npm run dev

Am debugging with @theogf atm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants