-
Notifications
You must be signed in to change notification settings - Fork 15
Bug: Incompatible with serverless-plugin-typescript #74
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
Comments
Thanks for the report. I'm digging in to see if I can repro your PR. Is the plugin actually failing a simple build? A reproduction of that would be way easier to diagnose if possible if you could put one up there? (The failure here appears to be symlink-related in the monorepo fixture. Jetpack doesn't do any symlinking, so it may just be an artifact of yarn workspaces + lerna symlinks fighting with the TS plugin or something). And what version of jetpack are you using? |
... I checked out your branch. With this diff: $ git diff serverless.yml
diff --git a/test/packages/monorepo/yarn/serverless.yml b/test/packages/monorepo/yarn/serverless.yml
index 145bff8..38ff27f 100644
--- a/test/packages/monorepo/yarn/serverless.yml
+++ b/test/packages/monorepo/yarn/serverless.yml
@@ -24,7 +24,6 @@ plugins:
modules:
- serverless-plugin-typescript
- serverless-offline
- - ../../../plugins/wrapper
provider:
name: aws Which completely removes $ SLS_DEBUG="*" STAGE="sandbox" AWS_REGION="us-east-1" serverless package I get your error, which means it's not jetpack specific I think:
Let's maybe have you turn to a minimal repository that produces the issue specific to jetpack so I can clone it, install, and follow your steps to a jetpack-specific error? Thanks! |
Oh, and as a helpful tip, if the TS plugin relies on setting And it the TS plugin creates a zip in lieu of serverless, then it will be incompatible jetpack, because that's pretty much all jetpack does. (If by contrast, it just creates JS transpiled files to get picked up my normal packaging, it should work just fine). |
Thanks Ryan! I think the issue might be the monorepo + serverless + jetpack + typescript... So it might be that the typescript plugin might not be compatible with jetpack's monorepo support? If I take jetpack out completely, the monorepo will stop working. So... the diff between "working" and "broken" will be a little bit more involved than I'd like. I'm just digging into serverless, trying to share TS models between my backend lambda and frontend react inside a lerna repo... I ran into an issue, found a bug, and saw your reply suggesting jetpack. |
I've taken a skim of First, the TS plugin appears to just straight up not work with lerna / yarn workspaces that do symlinks. Vanilla serverless should be able to package monorepo code, just not efficiently (you'll have to do lots of patterns and it won't correctly exclude devDeps). But it should be able to run. Here, with just vanilla serverless + TS plugin with no jetpack, things break. That needs to be solved first. I'd review upstream TS issues -- maybe this one? Second, if I'm reading things right, the TS plugin appears to build TS and deps in a separate path completely outside of serverless mechanics, then in a weirdly late hook ( ... so unless there's something more to the second issue, I think you're looking at:
Good luck and hope that helps! |
Manual ts build worked great! Thanks for the help! |
I know this is closed but I had this exact issue on Jenkins after I added a new npm package to the project. Looks like Jenkins was persisting the old TS compiled files and link to the node_modules folder. What I did to solve it was deleting the output folder (my folder is named |
In my case, there was anproblem in the serverless.yml file. There I added package: exclude: ["node_modules"] and this error had gone. |
When I add
serverless-plugin-typescript
to the project, I get some errors from typescript trying to unlink directories.PR for a breaking build:
dustyjewett#1
(I wasn't able to run
yarn test:cli
before or after my changes, so I'm just assuming the tests break, as I'm able to runserverless package
in the test directory on master, but it fails in my branch)The text was updated successfully, but these errors were encountered: