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

Fails to run on latest node 18 (18.19) #613

Open
jessedyck opened this issue Jan 13, 2024 · 1 comment
Open

Fails to run on latest node 18 (18.19) #613

jessedyck opened this issue Jan 13, 2024 · 1 comment

Comments

@jessedyck
Copy link
Contributor

jessedyck commented Jan 13, 2024

Issue

Does not run on the latest version of node 18 (18.19).

Repo

Attempt to run via a docker container using the below:

# Toggle node version here - node:18 becomes 18.19, which does not work. 18.18 does work.
FROM node:18-slim

EXPOSE 8600

WORKDIR /root/envcan
RUN apt update && apt install git -y

RUN git clone https://github.com/Forceh91/retro-env-can-weather-chan ./
RUN yarn install
RUN yarn build:display

ENTRYPOINT [ "yarn", "start" ]

Paste the above into a new Dockerfile in a new directory, then run docker build . --tag envcan && docker run -it envcan

Runs fine on node 18.18, but node 18.19 triggers the following:

yarn run v1.22.19
$ tsx src/server.ts

node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^
Error: tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0
    at X (file:///root/envcan/node_modules/tsx/dist/esm/index.mjs:1:1920)
    at Hooks.addCustomLoader (node:internal/modules/esm/hooks:202:24)
    at Hooks.register (node:internal/modules/esm/hooks:168:16)
    at async initializeHooks (node:internal/modules/esm/utils:167:5)
    at async customizedModuleWorker (node:internal/modules/esm/worker:104:24)

Node.js v18.19.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected Results

The readme file says the project should run on node 18 and above, but does not currently run on the latest node 18 (18.19).


node:20-slim does work, so perhaps the solution is to bump the supported node version?

@Forceh91
Copy link
Owner

Interesting... I persumed the GitHub pipelines that run on Node 18.x were using the latest. The tsx error message about deprecation makes no sense as 18.9 is before 20.6 afaik?

The --loader flag was deprecated in Node v20.6.0

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

2 participants