-
Notifications
You must be signed in to change notification settings - Fork 19
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
switch to tsm loader - #PLAT-853 #713
Conversation
PLAT-853 consider moving from ts-node to TSM
Descriptionsee TypeStrong/ts-node#1839 (comment) re the error
that appeared on dev cas api (node failed to run) @Sergey suggested to switch to TSM https://github.com/lukeed/tsm/blob/master/docs/usage.md do we want to do this, and if so we should do it soon? Technical InformationIf required provide a technical explanation of the work. |
(note did not remove the ts-node package from package.json because typeorm still uses it) |
I just tested this with docker-compose as well and sees to fix the issue This fails using ts-node/esm ceramic-anchor-service-cas_api-1 | > [email protected] start
ceramic-anchor-service-cas_api-1 | > node --loader ts-node/esm ./build/main.js
ceramic-anchor-service-cas_api-1 |
ceramic-anchor-service-cas_api-1 | (node:23) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
ceramic-anchor-service-cas_api-1 | (Use `node --trace-warnings ...` to show where the warning was created)
ceramic-anchor-service-cas_api-1 | Error [ERR_LOADER_CHAIN_INCOMPLETE]: "ts-node/esm 'resolve'" did not call the next hook in its chain and did not explicitly signal a short circuit. If this is intentional, include `shortCircuit: true` in the hook's return.
ceramic-anchor-service-cas_api-1 | at new NodeError (node:internal/errors:387:5)
ceramic-anchor-service-cas_api-1 | at ESMLoader.resolve (node:internal/modules/esm/loader:852:13)
ceramic-anchor-service-cas_api-1 | at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:7)
ceramic-anchor-service-cas_api-1 | at async Promise.all (index 0)
ceramic-anchor-service-cas_api-1 | at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
ceramic-anchor-service-cas_api-1 | at async loadESM (node:internal/process/esm_loader:91:5)
ceramic-anchor-service-cas_api-1 | at async handleMainPromise (node:internal/modules/run_main:65:12) {
ceramic-anchor-service-cas_api-1 | code: 'ERR_LOADER_CHAIN_INCOMPLETE'
ceramic-anchor-service-cas_api-1 | } This works using tsm ceramic-anchor-service-cas_api-1 | > [email protected] start
ceramic-anchor-service-cas_api-1 | > node --loader tsm ./build/main.js
ceramic-anchor-service-cas_api-1 |
ceramic-anchor-service-cas_api-1 | (node:21) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
ceramic-anchor-service-cas_api-1 | (Use `node --trace-warnings ...` to show where the warning was created)
ceramic-anchor-service-cas_api-1 | (node:21) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
ceramic-anchor-service-cas_api-1 | [2022-08-22T17:01:33.034Z] IMPORTANT: 'Connecting to database...'
ceramic-anchor-service-cas_api-1 | [2022-08-22T17:01:33.583Z] IMPORTANT: 'Connected to database: default'
ceramic-anchor-service-cas_api-1 | [2022-08-22T17:01:33.585Z] IMPORTANT: 'Starting Ceramic Anchor Service at version 0.0.67 with config:\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏇
APPROVE |
switch from esm to tsm loader - #PLAT-853
Description
The CAS api node failed to run in dev with the error
Error [ERR_LOADER_CHAIN_INCOMPLETE]: "ts-node/esm 'resolve'" did not call the next hook in its chain
@ukstv suggested switching to TSM loader to avoid this issue. See https://linear.app/3boxlabs/issue/PLAT-853/consider-moving-from-ts-node-to-tsm for further details.
How Has This Been Tested?
Able to run
npm run start
after switching to tsm loader locally. Need to test on dev, should we test by another method than deploying to dev?Definition of Done
Before submitting this PR, please make sure:
References:
Please list relevant documentation (e.g. tech specs, articles, related work etc.) relevant to this change, and note if the documentation has been updated.