Skip to content

When set moduleResolution to NodeNext, tsc won't compile paths aliasΒ #56350

Closed
@Ttou

Description

@Ttou

πŸ”Ž Search Terms

"NodeNext", "paths"

πŸ•— Version & Regression Information

  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://github.com/Ttou/nodenext-issue

πŸ’» Code

import { APP } from '@/constants/index.js'
import express from 'express';

const app = express()

app.get('/', (req, res) => {
  res.send('Hello World')
})

app.listen(APP.PORT, () => {
  console.log(`Server is running on port ${APP.PORT}`)
})

πŸ™ Actual behavior

dist/main.js

import { APP } from '@/constants/index.js';
import express from 'express';
const app = express();
app.get('/', (req, res) => {
    res.send('Hello World');
});
app.listen(APP.PORT, () => {
    console.log(`Server is running on port ${APP.PORT}`);
});
//# sourceMappingURL=main.js.map

πŸ™‚ Expected behavior

import { APP } from './constants/index.js';
import express from 'express';
const app = express();
app.get('/', (req, res) => {
    res.send('Hello World');
});
app.listen(APP.PORT, () => {
    console.log(`Server is running on port ${APP.PORT}`);
});
//# sourceMappingURL=main.js.map

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions