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

[🐛] Update Framework for Compatibility with Latest Node.js Version #38

Open
WilliamAcosta1 opened this issue Dec 11, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@WilliamAcosta1
Copy link
Member

WilliamAcosta1 commented Dec 11, 2023

The project is currently experiencing compatibility issues with the latest version of Node.js. When attempting to run the project using Node.js 20.x, the following error occurs:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/fernandomema/gitProjects/zumito-bot/src/Bot.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:141:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async Hooks.load (node:internal/modules/esm/hooks:448:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

Steps to Reproduce

Clone the repository: git clone https://github.com/ZumitoTeam/zumito-framework.git
Install dependencies: npm install
Attempt to run the project with Node.js 20.x: npm run start

Expected Behavior

The project should run successfully on the latest version of Node.js without encountering any compatibility issues.

Actual Behavior

The project fails to run on Node.js 20.x, and the following error is displayed:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/fernandomema/gitProjects/zumito-bot/src/Bot.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:141:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async Hooks.load (node:internal/modules/esm/hooks:448:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

Environment

Node.js version: 20.x
Operating System: Windows, linux

Possible Solution

Change start script from

"start": "ts-node-esm src/Bot.ts",

to

"start": "node --loader ts-node/esm src/Bot.ts",
@WilliamAcosta1 WilliamAcosta1 added the enhancement New feature or request label Dec 11, 2023
@fernandomema fernandomema changed the title Update Framework to the Latest Version of Node.js Update Framework for Compatibility with Latest Node.js Version Dec 11, 2023
@fernandomema fernandomema changed the title Update Framework for Compatibility with Latest Node.js Version [🐛] Update Framework for Compatibility with Latest Node.js Version May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant