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

[yarn] - Unable to install the node modules with Node 22+ #1936

Open
HackPoint opened this issue Jan 22, 2025 · 9 comments
Open

[yarn] - Unable to install the node modules with Node 22+ #1936

HackPoint opened this issue Jan 22, 2025 · 9 comments
Labels
bug Something isn't working build Build and GitHub related issues

Comments

@HackPoint
Copy link

Describe the Bug

Hi,
I'm trying to install the latest version of Kaoto ( UI ), by just simple running yarn install but it seems that I'm getting an error:
My settings are:

Apple M3 Max
Sonoma: 14.6.1 (23G93)

node -v
v22.12.0

yarn -v
4.5.0

java:
java: 21-oracle
➤ YN0009: │ kaoto@workspace:. couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/qc/pdvz_7sx4sv2kb7vzkg_x8d00000gn/T/xfs-ecb1e86c/build.log)
➤ YN0000: └ Completed in 1m 2s
➤ YN0000: · Failed with errors in 1m 2s

The error it self:
import catalogLibraryIndex from '../dist/camel-catalog/index.json' assert { type: 'json' };
                                                                   ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
    at #translate (node:internal/modules/esm/loader:437:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:484:27)
    at async ModuleJob._link (node:internal/modules/esm/module_job:115:19)

Steps to Reproduce the Bug or Issue

yarn install

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 0.30.0]
    Apple M3 Max
    Sonoma: 14.6.1 (23G93)
    Chrome: Version 131.0.6778.265 (Official Build) (arm64)
@HackPoint HackPoint added the bug Something isn't working label Jan 22, 2025
@lordrip
Copy link
Member

lordrip commented Jan 22, 2025

Hi @HackPoint , this seems to be related to node.js 22, could you try with node.js 20 instead?

@lordrip lordrip added the build Build and GitHub related issues label Jan 22, 2025
@apupier
Copy link
Member

apupier commented Jan 22, 2025

I confirm, I reproduce the error with Node 22.13.1

@apupier apupier changed the title [yarn] - Unable to install the node modules in the new version [yarn] - Unable to install the node modules with Node 22+ Jan 22, 2025
@lordrip
Copy link
Member

lordrip commented Jan 22, 2025

One solution could be to rewrite the existing Typescript script into Javascript, so we can remove ts-loader. We're open to contributions if that's something that might seem interesting to you @HackPoint 😃

@HackPoint
Copy link
Author

One solution could be to rewrite the existing Typescript script into Javascript, so we can remove ts-loader. We're open to contributions if that's something that might seem interesting to you @HackPoint 😃

I am working on extension just wanted to sync up with the latest. Still haven't saw the change list and much more documentation on how and where it's possible to extend the application. But I dislike React in way possible.

@lordrip
Copy link
Member

lordrip commented Jan 22, 2025

This is the build process rather than react, but point noted 😅

@HackPoint
Copy link
Author

Hi @HackPoint , this seems to be related to node.js 22, could you try with node.js 20 instead?

This does work with latest 20.18.2 but I will try to see how to fix that issue.

@lhein lhein moved this from New to Backlog in Kanban Board Jan 22, 2025
@lordrip
Copy link
Member

lordrip commented Jan 22, 2025

One quick thing to try is to remove the assert { type: 'json' } portion from:

import catalogLibraryIndex from '../dist/camel-catalog/index.json' assert { type: 'json' };

and rewrite the script in Javascript, basically just stripping the types from it and trying it.

@HackPoint
Copy link
Author

One quick thing to try is to remove the assert { type: 'json' } portion from:

import catalogLibraryIndex from '../dist/camel-catalog/index.json' assert { type: 'json' };

and rewrite the script in Javascript, basically just stripping the types from it and trying it.

I will try it, for sure. I'll update about it.

@HackPoint
Copy link
Author

@lordrip Say please who is responsible over the backend of the generation of the schema and the UI, I get some error when I try to extend the UI with new .yaml template. Who can elaborate of how the schema is validated and generated in the UI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Build and GitHub related issues
Projects
Status: Backlog
Development

No branches or pull requests

3 participants