Skip to content

Node Module Resolution is being deprecated with TypeScript 7.0 #897

@amitrayblr

Description

@amitrayblr

Environment

Node 22.20.0

Steps to Reproduce

Copy tsconfig.json from https://www.motia.dev/docs/development-guide/project-structure

{ "compilerOptions": { "target": "ES2020", "module": "ESNext", "moduleResolution": "Node", "esModuleInterop": true, "strict": true, "skipLibCheck": true }, "include": ["**/*.ts", "**/*.tsx"], "exclude": ["node_modules", "dist"] }

Expected Behavior

"moduleResolution": "Node" is being deprecated as of TypeScript 7.0.

According to the official typescript issue, projects that depend on node10 should shift over to "moduleResolution": "bundler"

microsoft/TypeScript#62200

Actual Behavior

npm run dev with "moduleResolution": "Node" runs the app fine. I haven't gotten to the point of adding steps, and building. I assume that the app will build fine.

Switching over to "moduleResolution": "bundler" however causes errors.

Relevant Logs/Console Output

TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.

    at createTSError (/src-motia/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/src-motia/node_modules/ts-node/src/index.ts:863:19)
    at /src-motia/node_modules/ts-node/src/index.ts:1379:34
    at Object.compile (/src-motia/node_modules/ts-node/src/index.ts:1458:13)
    at Module.m._compile (/src-motia/node_modules/ts-node/src/index.ts:1617:30)
    at node:internal/modules/cjs/loader:1839:10
    at require.extensions.<computed> (/src-motia/node_modules/ts-node/src/index.ts:1621:12)
    at Object.require.extensions.<computed> [as .ts] (/src-motia/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12) {
  diagnosticCodes: [ 5095 ]
}

Screenshots

Image

Motia Version

0.8.4-beta.141

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationmedium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions