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

ERR_UNKNOWN_FILE_EXTENSION issue with ssg example #28

Open
MatteoGauthier opened this issue Oct 9, 2023 · 1 comment
Open

ERR_UNKNOWN_FILE_EXTENSION issue with ssg example #28

MatteoGauthier opened this issue Oct 9, 2023 · 1 comment

Comments

@MatteoGauthier
Copy link

Got an issue when I try to run the ssg example

yarn run example-ssg
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/userr/dev/PeopleProjects/jikji/example/ssg/index.ts
    at new NodeError (node:internal/errors:405:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
    at defaultLoad (node:internal/modules/esm/load:120:20)
    at nextLoad (node:internal/modules/esm/hooks:832:28)
    at load (/private/var/folders/sz/b39nbqfn35g26y1pt_t7j3nr0000gn/T/xfs-f9712a67/dlx-12977/node_modules/ts-node/dist/child/child-loader.js:19:122)
    at nextLoad (node:internal/modules/esm/hooks:832:28)
    at Hooks.load (node:internal/modules/esm/hooks:415:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
@MatteoGauthier
Copy link
Author

I resolved the issue by replacing ts-node with tsx 👍

+    "start-ssg": "yarn build && yarn dlx -p tsx tsx ssg/index.ts",
-    "start-ssg": "yarn build && yarn dlx -p ts-node ts-node --esm ssg/index.ts",

@MatteoGauthier MatteoGauthier changed the title ERR_UNKNOWN_FILE_EXTENSION issue with sgg example ERR_UNKNOWN_FILE_EXTENSION issue with ssg example Oct 9, 2023
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

1 participant