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

Error ID: 43997dd244c04e9c96199d94a8b170bc #84

Closed
henrymgarrett opened this issue Apr 12, 2024 · 2 comments
Closed

Error ID: 43997dd244c04e9c96199d94a8b170bc #84

henrymgarrett opened this issue Apr 12, 2024 · 2 comments

Comments

@henrymgarrett
Copy link

Hey all, I'm trying to deploy an npm workspaces monorepo that uses Typescript project references for code sharing.
When deploying normally (no language specific inputs to the stacktape buildback), I received the following error:
Config:

          packaging:
            type: stacktape-image-buildpack
            properties:
              entryfilePath: ./packages/api/src/index.ts

Error

PACKAGING: Failed to build code at ./packages/api/src/index.ts
          Can't resolve '@receipts-xyz/service' (imported from ./packages/api/src/resolvers/index.ts:4:28).
        There might be 2 reasons this has happened:
          1. These dependencies are not installed.
          2. These dependencies are imported (required) conditionally and your application does not need them, but Stacktape still tries to statically bundle them.

So I tried to include the language specific parameters:

          packaging:
            type: stacktape-image-buildpack
            properties:
              entryfilePath: ./packages/api/src/index.ts
              # The below causes an error for some reason.  TBD
              languageSpecificConfig:
                outputModuleFormat: 'esm'
                tsConfigPath: './packages/api/tsconfig.json'

And receive the following error:

UNEXPECTED_ERROR] An unexpected error occurred. Last captured event: PACKAGE_ARTIFACTS.
[HINT] This error has been anonymously reported to our error monitoring service with id 43997dd244c04e9c96199d94a8b170bc.

The repo structure is like so:

/packages
/api
package.json
tsconfig.json -> this references the service directory tsconfig.json via references
/service
package.json
tsconfig.json
tsconfig.json -> root config that all package tsconfig.json's inherit from

@matuscongrady
Copy link
Contributor

Hello Henry,

The issue you're encountering is (most likely) related to Stacktape not being able to parse your tsconfig.json due to the fact that it includes comments. This has been resolved in version 2.5.5 and should now work properly.

That being said, Stacktape should be able to package (resolve) imports from your workspaces automatically. We've created example projects:

Please also make sure that you've run your initial installation using a proper package manager, and that a lockfile for your package manager of choice has been generated.

Note that Stacktape performs package installation before packaging workloads (containers and lambda functions), that use stacktape-native buildpack. It deduces the correct package manager based on the lockfile being present in the repository, and defaults to npm if none has been found.

@simi-obs
Copy link

Closing as resolved

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

3 participants