You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using multiple runtimes and explicit artifact, receive Cannot access package artifact error #281
Hard to describe, but this is when using multiple runtimes, and the other runtime has manual packaging. So we use the package.artifact configuration in serverless.yml, e.g.:
When I try to package or deploy (e.g. sls deploy), after compiling the typescript it fails with this error:
Error:
Cannot access package artifact at "target/hello-dev.jar" (for "hello"): ENOENT: no such file or directory, access '[REDACTED]/serverless-packaging-bug/.build/target/hello-dev.jar'
This seems to be caused by the code in index.ts in the compileTs function, with this line: this.serverless.config.servicePath = path.join(this.originalServicePath, BUILD_FOLDER)
Since this doesn't get cleaned up until the very end, it messes with other parts of the serverless build process. That path seems to be where serverless looks for my artifact.
I found the real problem, Serverless changed the Serverless.config.servicePath to Serverless.config.serviceDir in version 3. So all the servicePath mangling amounts to naught.
Has there been any movement or workarounds on this? I've got a project that is traditional java that I'm migrating to nodejs. I'll have both a java artifact and using serverless-plugin-typescript and am experiencing the exact same issue mentioned above.
Rather not hack the code myself unless I need to. Any help is appreciated!
We have experienced the exact same issue on our Serverless Framework project. We ended by migrated our stack to SST (https://sst.dev) ; because now it support correctly an API with both Java and TS endpoints... And this is only the top of the iceberg. It's easy to deploy your web app in SST too 🤓
Activity
vectorjohn commentedon Oct 20, 2022
I found the real problem, Serverless changed the
Serverless.config.servicePathtoServerless.config.serviceDirin version 3. So all the servicePath mangling amounts to naught.fix(serverless#281): add serviceDir to Serverless config
fix(serverless#281): Fixes the bug
chore(serverless#281): cleanup commented out code, remove logging
MatejBalantic commentedon Feb 24, 2023
+1 experiencing this exact problem with mixed project (golang + typescript). @vectorjohn do you recommend any workaround for this problem ?
dotdave00 commentedon Mar 20, 2023
Has there been any movement or workarounds on this? I've got a project that is traditional java that I'm migrating to nodejs. I'll have both a java artifact and using serverless-plugin-typescript and am experiencing the exact same issue mentioned above.
Rather not hack the code myself unless I need to. Any help is appreciated!
julbrs commentedon Mar 20, 2023
Hi,
We have experienced the exact same issue on our Serverless Framework project. We ended by migrated our stack to SST (https://sst.dev) ; because now it support correctly an API with both Java and TS endpoints... And this is only the top of the iceberg. It's easy to deploy your web app in SST too 🤓