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

Unable to install latest version #317

Open
jaydeanmartin opened this issue Oct 3, 2024 · 10 comments
Open

Unable to install latest version #317

jaydeanmartin opened this issue Oct 3, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@jaydeanmartin
Copy link

Description

I tried to update the version of this library to the latest version (0.18.9), but it fails to load due to an error similar to:
error @primer/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.18.0 <18.19.0". Got "20.16.0"

The latest version I am able to install using the same installation (version) of node.js is 0.17.0

Reproduce

Either >yarn install @datalayer/jupyter_react
or edit package.json file and update the version number for the package. I use this route since I am building in a Docker container.

Expected behavior

The latest version of this library should include dependencies that work node.js 20.16.0

Context

  • Datalayer version: 0.18.9 (or any 0.18 version)
  • Operating System and version: UBI Docker container using node.js version 20.16.0
  • Browser and version: N/A
@jaydeanmartin jaydeanmartin added the bug Something isn't working label Oct 3, 2024
@echarles
Copy link
Member

echarles commented Oct 3, 2024

agree we need to look at that. As temp workaround, --ignore-engines could be used.

@jaydeanmartin
Copy link
Author

thank you for the suggested work-around. Using the option does allow the code to "compile", but I am running into a Module not found: Error: Can't resolve '@jupyterlite/pyodide-kernel-extension' in '/app/node_modules/@datalayer/jupyter-react/lib/jupyter/services'

I was running into other library compatibility issues trying to use 0.17.0.

I have no intention of using jupyterlite in this project and wouldn't mind having it as an optional include to keep things lighter-weight. I tried to yarn add @jupyterlite/pyodide-kernel-extension but this continues to throw the same error in the original post. (with and without the --ignore-engine option).
Thank you

@vladtimss
Copy link

also have the same problem

@echarles
Copy link
Member

echarles commented Oct 4, 2024

The mandatory jupyterlite deps are giving quite some headcache, especially in non webpack env like vite or next.js

Having a package that covers both server kernels and browser kernels is something appealing, hence the integration we have done. I am happy to explore ways to make it easier to cover maximum platform and versions.

Any contribution or discussion is welcome.

@jaydeanmartin
Copy link
Author

I am not quite ready to contribute at this point, but I am happy to discuss.

The first point that confuses me is "both server kernels". Is there a difference between JupyerLab, Jupyter server, and JupyterHub in how you connect/communicate with them?

I think having a few (2 or 3) branches for these different use cases would be fine if it helps deconflict some dependencies, simplifies development and maintenance, and reduces the library size to include fewer unused components.

  • the rest of this post is extraneous information and not necessarily important to the discussion *

In my specific case (which is all I know anything about, unfortunately), I am using a Jupyter server, but I am installing a different kernel (not Python but the latest version of SysML v2). I want to have a single cell to edit code, evaluate it, and do 2 or 3 different magic commands that are specific to the SysMLv2 kernel. Some of these will return graphics.

I am using Docker containers to hold all of my many different services (node.js, Django, Postgres, Jupyter server, and many others).

I am starting to understand the use of the tag in setting up a context and the use of useJupyter() within that context to get the kernel connection properties (I can use that to evaluate my "magic" functions with kernel.execute()?) I can use the <Cell? tags to make an editable panel (which I assume uses codemirror). and I can evaluate this cell with no issues using my custom kernel on the Jupyter server running in another container. Eventually, I would like to override the language settings for the Cell to include my keywords, comment strings, colors, and code completions - but that can wait.

@echarles
Copy link
Member

echarles commented Oct 5, 2024

The engine "node" is incompatible with this module. Expected version ">=18.18.0 <18.19.0". Got "20.16.0"

Does "@primer/primitives": "^9.1.2" fixes the isue?

Error: Can't resolve '@jupyterlite/pyodide-kernel-extension' in '/app/node_modules/@datalayer/jupyter-react/lib/jupyter/services'

Looks like you are developing a next.js app, right?

I think having a few (2 or 3) branches for these different use cases would be fine if it helps deconflict some dependencies, simplifies development and maintenance, and reduces the library size to include fewer unused components.

Maybe packages instead of branches. not sure we can significantly reduce the package size, we need jupyterlab anyway which is the main contributor to the size.

Maybe making jupyterlite a peerdependency could help.

I want to have a single cell to edit code, evaluate it, and do 2 or 3 different magic commands that are specific to the SysMLv2 kernel. Some of these will return graphics.

What is available should allow you to implement that.

I am starting to understand the use of the tag in setting up a context and the use of useJupyter() within that context to get the kernel connection properties (I can use that to evaluate my "magic" functions with kernel.execute()?) I can use the <Cell? tags to make an editable panel (which I assume uses codemirror). and I can evaluate this cell with no issues using my custom kernel on the Jupyter server running in another container. Eventually, I would like to override the language settings for the Cell to include my keywords, comment strings, colors, and code completions - but that can wait.

Could you open separated issues to track to feature requests?

@jaydeanmartin
Copy link
Author

@echarles Thank you for your responses. I will post additional comments/questions in a separate issue as requested.

@jaydeanmartin
Copy link
Author

I added @primer/primitives, this also requires adding styled-components.
This does not resolve the issue with version 0.18.9 of @datalayer/jupyter-react.
The last version that does work for me is version 0.16.0.
I am not using Next.js. I am not really using any framework and maybe I should be. Is there a suggested one for this type of application? I do not think I am using any Javascript on the server side, just in the frontend in the web browser.
Thank you again

@fcollonval
Copy link
Member

Hi

I run the following steps:

docker run -it registry.access.redhat.com/ubi9/nodejs-20-minimal /bin/bash
# Within the docker
npm install -g corepack
corepack enable
yarn init -2
yarn add @datalayer/jupyter-react

I did not encounter any issue.

The installed version for yarn was 4.5.0 and node v20.16.0

@jaydeanmartin
Copy link
Author

I was also using an UBI based container running node20, but it was failing in my situation. I may have other dependencies in my project that are incompatible. I do not know.
I was able to build against a node:18.18.2-slim container with few issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants