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
Issue with lightningcss dependency in Vite 5.0 affecting Serverless deployment - Missing ../pkg #701
Comments
same issue with turborepo |
same with expo / react-native. |
same issue with Bun.build |
@mercer08 did you find some workaround? |
@devongovett can be related with the files in package.json? Lines 35 to 40 in baa1a2b
In this code, looks that there are dependencies of other files: Lines 15 to 23 in baa1a2b
At least:
However, I see that these files do not exist in the repo either... Are they generated during the build or how does it work? Thanks |
The problem is that your package manager (eg npm) is not installing the optional dependencies in the package. There is a dependency per os/cpu architecture that should be installed. The error you see here is because we attempt to fall back to a local version if the those packages are not found (for local development). You'll need to check why your package manager is not working properly. It could be:
|
Probably is more related with Running Probably the same is happening to @mercer08 that comments that is happening in the build process. |
What platform are you running on? That means operating system/cpu. |
|
Then you're definitely on a supported platform. Your package manager isn't working properly. It should be installing lightningcss-darwin-arm64. |
I'm using |
I am using Yarn berry with pnp. It does install the optional dependencies appropriately (lightningcss-darwin-arm64 for m1 mac) but I still get the error on the relative |
hmm now looking at the code, it seems that is also behind an environment variable check. Is that somehow set on your system? |
lightningcss/node/index.js
Line 16 in baa1a2b
Description
After upgrading to Vite 5.0 for our Serverless application, we encountered an issue related to the
lightningcss
dependency. Specifically,lightningcss
tries to require a module using a relative path (../pkg
), which does not exist in its package structure. This issue is causing our Serverless deployment process to fail, displaying the following error:This problem seems to stem from the new version of Vite's dependency on
lightningcss
, which is now causing issues during the Serverless deployment phase.Steps to Reproduce
lightningcss
either directly or indirectly.serverless deploy
) or during the build process triggered by Serverless.Expected Behavior
The Serverless deployment process should complete successfully without encountering errors related to missing modules in
lightningcss
.Actual Behavior
The deployment process fails due to an unresolved module path in
lightningcss
, specifically pointing to the missing../pkg
module. This prevents the Serverless application from being deployed successfully.Environment
lightningcss
Version: ^1.24.0"serverless-esbuild": "^1.44.0",
Attempts to Resolve
@lightningcss/core
.lightningcss
repositories and community forums.None of the above steps have resolved the issue, which seems specific to the integration of Vite 5.0 and
lightningcss
in the context of Serverless deployments.Additional Context
This issue is critically impacting our ability to deploy updates to our Serverless application. We rely on the Serverless Framework for deploying our application to AWS Lambda, and the current issue with
lightningcss
is blocking our deployment pipeline.Any insights, workarounds, or fixes for this problem would be greatly appreciated. Thank you for your time and support.
The text was updated successfully, but these errors were encountered: