Skip to content
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

[BUG] This plugin borks something with package artifacts #287

Open
darylteo opened this issue Apr 13, 2023 · 2 comments
Open

[BUG] This plugin borks something with package artifacts #287

darylteo opened this issue Apr 13, 2023 · 2 comments

Comments

@darylteo
Copy link

darylteo commented Apr 13, 2023

I'm using the package.artifact functionality for a different function that is not typescript. But enabling this plugin borked packaging of other functions using package.artifact.

I'm not sure how else to describe it so here's a video.

https://imgur.com/DnztNvA

From this it seems that it mangles a path library, or maybe changes the state of the serverless options which causes problems down the chain of plugins.

Even if I move the artifact to the place it tries to look at (in the .build directory), it then tries to inside .serverless instead.

https://imgur.com/jlk7k5w

Incredibly annoying, hope I can find a workaround for this.

Reproduction Repro here.
https://github.com/darylteo/serverless-plugin-typescript-bug-repro

Does it have something to do with the outDir and rootDir in tsconfig?

@darylteo
Copy link
Author

darylteo commented Apr 13, 2023

Or is it related to these lines mutating the serverless service?

    if (!this.originalServicePath) {
      // Save original service path and functions
      this.originalServicePath = this.serverless.config.servicePath
      // Fake service path so that serverless will know what to zip
      this.serverless.config.servicePath = path.join(this.originalServicePath, BUILD_FOLDER)
    }

this.serverless.config.servicePath = path.join(this.originalServicePath, BUILD_FOLDER)

@darylteo
Copy link
Author

darylteo commented Apr 13, 2023

Okay i should be able to workaround this with serverless compose since the change is limited only to the service.

Complicates things a bit but I think it's workable. Just noisy because I would to set up separate services which creates separate stacks, and also set up vars, envs, and plugins between services.

This is also less ideal because Serverless Compose does not currently support running multiple services under the same serverless-offline instance. dherault/serverless-offline#1386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant