Closed chan-dev closed 4 years ago
Hey @chan-dev ! Thanks for contributing. So this is a tsc
compilation problem as far as I see. It doesn't have much to do with module-alias
. It might be that the build script is not run from the correct directory in the heroku buildpack... They do a bunch of stuff which might lead to surprise effects (for example, node_modules
is installed somewhere outside your project, and then symlinked into your project dir).
If I were you, I'd try to:
server
directory in Herokutsconfig.json
../shared
is actually thereI guess I see what you mean with:
const tags_1 = require("@constants/tags");
However this should work with module-alias
though, as long as you run require('module-alias/register')
before.
Closing this as it's more tsc
+ Heroku related.
I have this kind of structure. I omit some of the files
Here's my tsconfig.json
Here's the package.json with moduleAlias
Here's the relevant npm scripts
When i execute
npm run build
in docker or heroku. It always returns this kind of errors:Looking at the compiled javascript files, the path mappings are not resolved to their corresponding paths
Here's an snippet of one of the compiled js files
As you can see the line
require("@constants/tags")
is not resolved.