-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: using typescript template in an nx monorepo #40
Comments
Hi @DaveLo and thanks for reporting your issue.
Indeed, the result from #28 shows that using env variable Is this solution compatible with your monorepo usage (you'd have to specify a dedicated env variable for each module I believe) ? |
I did try that, but it seems to still latch onto there being a tsconfig.json in the directory? I thought it was interesting that running the same command (with the env var) would fail with a tsconfig.json in the lib and succeed if I changed that to tsconfig.lib.json. If that didn't break typescript references inside the directory it would be workable , but sadly it seems to (probably something with how Nx works behind the scenes?). To get unblocked I've switched the app to using a yaml file and that seems to mostly work (although sad because I love the way the ts template is structured and having type hints). |
Hi @DaveLo, if you want to get involved in this, we're currently reworking the way serverless framework loads service file defined in TS in this issue serverless/serverless#9311 |
I think this is somewhat related to #28 ,
I'm getting initialization errors when I try to run serverless commands in the nx app directory. This happens whether I cd into the the directory and run manually or use nx run commands.
What I've noticed is if I point serverless webpack at
tsconfig.app.json
, but there is atsconfig.json
file in the same directory I get an initialization error. If I rename the tsconfig file to something else then the serverless.ts file will initialize and run serverless commands, but I lose my paths info from the monorepo context.I feel like there is probably a setting (or there should be) to tell serverless to use exactly this tsconfig file only and ignore others?
code
tsconfig files
serverless file
error text
interestingly it is compiling, because line 59 of the ts file is not the export statement.
If I run a
tsc
in the directory it compiles to js and adds anexport {}
on line 59; however, if I add the--project
flag withtsconfig.app.json
it compiles correctly and serverless will run that compiled js file with no issue.env
The text was updated successfully, but these errors were encountered: