navneetsharmaui / sveltekit-starter

Sveltekit starter project created with sveltekit, typescript, tailwindcss, postcss, husky, and storybook. The project has the structure set up for the scaleable web application.
https://sveltekit-starter-one.vercel.app
MIT License
609 stars 100 forks source link

ERR_UNKNOWN_FILE_EXTENSION Unknown file extension ".ts" #34

Closed IsaacHub closed 2 years ago

IsaacHub commented 2 years ago

Describe the bug I got TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

To Reproduce Steps to reproduce the behavior:

  1. npm install
  2. npm run dev

> sveltekit-starter@1.0.0 dev
> npm run check-env && npm run add-css && npm run dev:sveltekit

> sveltekit-starter@1.0.0 check-env
> node --loader ts-node/esm scripts/js/check-env.ts

(node:16092) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for E:\projects\Newfolder\sveltekit-starter-main\scripts\js\check-env.ts
    at new NodeError (node:internal/errors:371:5)
    at Object.file: (node:internal/modules/esm/get_format:72:15)
    at defaultGetFormat (node:internal/modules/esm/get_format:85:38)
    at defaultLoad (node:internal/modules/esm/load:13:42)
    at ESMLoader.load (node:internal/modules/esm/loader:303:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:58)
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:244:11)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

Here is the system info:

  System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 3.89 GB / 15.91 GB
  Binaries:
    Node: 16.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.1 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @sveltejs/adapter-netlify: ^1.0.0-next.30 => 1.0.0-next.30
    @sveltejs/adapter-node: ^1.0.0-next.43 => 1.0.0-next.43
    @sveltejs/adapter-static: ^1.0.0-next.17 => 1.0.0-next.17
    @sveltejs/adapter-vercel: ^1.0.0-next.26 => 1.0.0-next.26
    @sveltejs/kit: ^1.0.0-next.142 => 1.0.0-next.142
    svelte: ^3.42.3 => 3.42.3
github-actions[bot] commented 2 years ago

Message that will be displayed on users first issue

Benhawkins18 commented 2 years ago

Same issue

koenraijer commented 2 years ago

Same here...

opentechexpert commented 2 years ago

Update from "ts-node": "^10.2.1" to "ts-node": "^10.5.0". Should work.

github-actions[bot] commented 2 years ago

The issue had been stale for a long time. Closing the issue for now. You can reopen the issue.