chartjs/chartjs-adapter-luxon

chartjs-adapter-luxon v1.3.1 throws an "Unknown file extension ".ts" " error when executing unit tests

Opened this issue · 0 comments

Hi team. Previously, I had chartjs-adapter-luxon node module version set to v1.2.0. Works without any issues with NodejS v.18.16.1. Since I've updated the node module to v1.3.1, something in this module seems to throw an "Unkown file extension ".ts" " error when I execute unit tests (no related to chartjs or luxon). When I revert back this node module to v1.2.0, my unit tests works fine

C:\Users\AnUser\Desktop\Projects\Web-Server>yarn test
yarn run v1.22.19
$ npm run initDBTest && npm run execTests

> web-server@0.0.0 initDBTest
> run-script-os

$ .\scripts\initDBTest.sh

> web-server@0.0.0 execTests
> cross-env DEBUG=undefined nyc mocha --timeout 999999 --colors --reporter mocha-jenkins-reporter --require ts-node/register 'test/**/*.spec.ts' --unit-tests


TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for C:\Users\AnUser\Desktop\Projects\Web-Server\test\AlarmLimitRepository.spec.ts
    at new NodeError (node:internal/errors:399:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:121:38)
    at defaultLoad (node:internal/modules/esm/load:81:20)
    at nextLoad (node:internal/modules/esm/loader:163:28)
    at ESMLoader.load (node:internal/modules/esm/loader:605:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
    at new ModuleJob (node:internal/modules/esm/module_job:64:26)
    at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:480:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here's my dependencies:

"dependencies": {
    "@types/cls-hooked": "4.3.4",
    "@vvo/tzdb": "6.108.0",
    "archiver": "5.3.1",
    "bcryptjs": "2.4.3",
    "chart.js": "4.3.0",
    "chartjs-adapter-luxon": "1.3.1",
    "chartjs-node-canvas": "4.1.6",
    "cls-hooked": "4.2.2",
    "commander": "11.0.0",
    "compare-versions": "6.0.0",
    "cors": "2.8.5",
    "csv": "6.3.1",
    "dbus-next": "0.10.2",
    "debug": "4.3.4",
    "express": "4.18.2",
    "fast-xml-parser": "4.2.5",
    "flatbuffers": "2.0.4",
    "formidable": "3.5.0",
    "fs-extra": "11.1.1",
    "helmet": "5.0.2",
    "hpp": "0.2.3",
    "http-proxy": "1.18.1",
    "ini": "4.1.1",
    "inversify": "6.0.1",
    "ip-address": "8.1.0",
    "ip-range-check": "0.2.0",
    "ip-to-int": "0.3.1",
    "jsonwebtoken": "9.0.1",
    "lodash": "4.17.21",
    "luxon": "3.3.0",
    "morgan": "1.10.0",
    "network": "0.6.1",
    "node-sequelize-stream": "2.0.3",
    "nodemailer": "6.9.3",
    "pdfkit": "0.13.0",
    "pg": "8.11.1",
    "pg-hstore": "2.3.4",
    "reflect-metadata": "0.1.13",
    "rxjs": "7.8.1",
    "sequelize": "6.32.1",
    "serve-favicon": "2.5.0",
    "serve-static": "1.15.0",
    "winston": "3.9.0",
    "winston-syslog": "2.7.0",
    "winston-transport": "4.5.0",
    "ws": "8.13.0",
    "zeromq": "6.0.0-beta.6"
  },
  "devDependencies": {
    "@redocly/cli": "1.0.0-beta.131",
    "@types/archiver": "5.3.2",
    "@types/bcryptjs": "2.4.2",
    "@types/bluebird": "3.5.38",
    "@types/chai": "4.3.5",
    "@types/chai-as-promised": "7.1.5",
    "@types/cors": "2.8.13",
    "@types/debug": "4.1.8",
    "@types/express": "4.17.17",
    "@types/formidable": "3.4.0",
    "@types/fs-extra": "11.0.1",
    "@types/hpp": "0.2.2",
    "@types/http-proxy": "1.17.11",
    "@types/ini": "1.3.31",
    "@types/jsonwebtoken": "9.0.2",
    "@types/lodash": "4.14.195",
    "@types/luxon": "3.3.0",
    "@types/mocha": "10.0.1",
    "@types/morgan": "1.9.4",
    "@types/node": "20.4.1",
    "@types/nodemailer": "6.4.8",
    "@types/pdfkit": "0.12.10",
    "@types/pg": "8.10.2",
    "@types/supertest": "2.0.12",
    "@types/winston-syslog": "2.4.0",
    "@types/ws": "8.5.5",
    "@types/zeromq": "5.2.2",
    "@typescript-eslint/eslint-plugin": "6.0.0",
    "@typescript-eslint/parser": "6.0.0",
    "chai": "4.3.7",
    "chai-as-promised": "7.1.1",
    "chai-events": "0.0.3",
    "cross-env": "7.0.3",
    "dotenv": "16.3.1",
    "eslint": "8.44.0",
    "eslint-plugin-header": "3.1.1",
    "eslint-plugin-import": "2.27.5",
    "mocha": "10.2.0",
    "mocha-jenkins-reporter": "0.4.8",
    "nyc": "15.1.0",
    "rimraf": "5.0.1",
    "run-script-os": "1.1.6",
    "supertest": "6.3.3",
    "ts-node": "10.9.1",
    "typedoc": "0.24.8",
    "typescript": "5.1.6"
  }

Here's the command I use to run my unit tests: "cross-env DEBUG=undefined nyc mocha --timeout 999999 --colors --reporter mocha-jenkins-reporter --require ts-node/register 'test/**/*.spec.ts' --unit-tests"

When running my unit tests, it fails at the first unit tests file in the list of unit tests to execute. And as I said, when reverting chartjs-adapter-luxon to v1.2.0, my unit tests works without any problem.

Can you please help me to resolve this issue ?

OS: Windows 10
NodeJS: v18.16.1

Thanks