TS6059

error TS6059: File ‘/root/project/packages/server/package.json‘ is not under ‘rootDir’ ‘/root/project/packages/server/src‘. ‘rootDir’ is expected to contain all source files.

Bad Code ❌

1
import pkg from '../../../../package.json';

Fixed Code ✔️

1
const pkg = require('../../../../package.json');