Tsed: [QUESTION] v5 to v6 Migration Issues

Created on 15 Mar 2021  路  3Comments  路  Source: tsedio/tsed

I'm migrating from v5 to v6.
For the sake of a clean migration - I completely recreated the project using the tsed cli. I'll copy my existing code from v5 into it.

1) I'm getting the following error when executing npm start (as created by tsed cli with no changes), and I'm getting the following error:
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped

2) I'm trying to use dotenv with the new npm start created by the tsed cli.

Until now this is how I've been running my server locally in v5 while injecting my env file:
nodemon --watch src/**/*.ts --ignore node_modules/**/* --exec ts-node -r dotenv/config src/index.ts dotenv_config_path=dev.env

I tried to append dotenv to the npm start created by the tsed cli in v6, but the server won't go up (it doesn't even get to the "Start Server..." log):
tsnd --inspect --ignore-watch node_modules --respawn --transpile-only -r tsconfig-paths/register dotenv/config src/index.ts dotenv_config_path=dev.env

Of course it does run as expected before modifying npm start, excluding dotenv:
tsnd --inspect --ignore-watch node_modules --respawn --transpile-only -r tsconfig-paths/register src/index.ts

question

All 3 comments

Hello @royibernthal

the first point isn鈥檛 an error. Just a warning. I think if you add the baseUrl in your tsconfig, it should solve the warning.

You don鈥檛 need to specify something for dotenv. Dotenv explain how the files are loaded.
I don鈥檛 know why the server doesn鈥檛 start and I can鈥檛 help you (I鈥檓 not the author of tsnd/dotenv).
But I鈥檓 pretty sure this not related to v6.

See you
Romain

Hey @Romakita

Thanks for the quick response.

baseUrl - You're right.

DotEnv - Fair enough. I managed to get it to work with a different approach.

More migration questions coming soon :) (probably)

Regards,
Royi

Sure ;) your feedback is welcome :)

Was this page helpful?
0 / 5 - 0 ratings