parcel-bundler / parcel-bundler/lightningcss
Issue with lightningcss dependency in Vite 5.0 affecting Serverless deployment - Missing ../pkg
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
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
- Upgrade Vite to version 5.0 in a Serverless project that uses
lightningcsseither directly or indirectly. - Attempt to deploy the project using Serverless Framework (
serverless deploy) or during the build process triggered by Serverless. - Observe the error as the deployment or build process fails.
/bin/sh: line 1: 6615 Terminated npm run deploy:testdev
ERROR Error: Command failed: cd fdnode && npm run deploy:testdev
Deploying fdssr to stage dev (ap-northeast-1)
��� [ERROR] Could not resolve "../pkg"
node_modules/lightningcss/node/index.js:16:27:
16 ��� module.exports = require(`../pkg`);
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
- OS: linux
- Node Version: Node.js v20.10.0
- Vite Version: ^5.1.5
lightningcssVersion: ^1.24.0- Serverless Framework Version: "serverless": "^3.30.1",
"serverless-esbuild": "^1.44.0", - Package Manager: npm
Attempts to Resolve
- Reinstalled all project dependencies.
- Directly installed
@lightningcss/core. - Searched for similar issues in both Vite and
lightningcssrepositories and community forums. - Checked and attempted to adjust Serverless packaging configurations to bypass the issue.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with node_modules/lightningcss/node/index.js at line 16 and the referenced lightningcss node/index.js source, then reproduce the failure with the listed Vite, Serverless Framework, and serverless-esbuild versions using serverless deploy. Trace why ../pkg is unavailable during packaging and verify that the deployment completes without the unresolved-module error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, vite
- Domain
- build-system, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100