Comments (17)
@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:
pkg/*
node/*.node
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
from lightningcss.
same issue with turborepo
from lightningcss.
same with expo / react-native.
from lightningcss.
same issue with Bun.build
from lightningcss.
@mercer08 did you find some workaround?
from lightningcss.
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:
- You have the --no-optional flag enabled, which would prevent installing optional dependencies.
- You're running on an unsupported platform.
- A bug in your package manager (eg npm/cli#4828). Try deleting node_modules and your package lock file and installing again.
from lightningcss.
Probably is more related with 2. You're running on an unsupported platform.
. This happens after build a CLI, and this CLI can be used on any platform to build the files using Bun.build
and lightningcss
, but lightningcss
lib is included in the bundle, and the problems comes after this CLI build.
Running Bun.build
with lightningcss
in runtime without the CLI it works.
Probably the same is happening to @mercer08 that comments that is happening in the build process.
from lightningcss.
What platform are you running on? That means operating system/cpu.
from lightningcss.
What platform are you running on? That means operating system/cpu.
uname -mprs
: Darwin 23.4.0 arm64 arm- Chip: Apple M1 Pro
- Memory: 16 GB
- macOS: 14.4.1 (23E224)
from lightningcss.
Then you're definitely on a supported platform. Your package manager isn't working properly. It should be installing lightningcss-darwin-arm64.
from lightningcss.
I'm using bun
as a package manager, and it install all dependencies
, devDependencies
, andoptionalDependencies
. Without doing the build of my CLI, it works. The problem comes when generating the build that probably does not add the optionalDependencies
inside the final code. I'm still investigating and see if this is it, but thanks for your feedback @devongovett.
from lightningcss.
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 ../pkg
path line. Is getting the optional dependencies installed enough here in this case. Would you recommend doing something more? @devongovett
from lightningcss.
hmm now looking at the code, it seems that is also behind an environment variable check. Is that somehow set on your system?
from lightningcss.
I have same problem.
I'm not sure if this is a problem with lightningcss
. I can reproduce the problem in the following way.
It seems to be caused by the side effects of the vite
package.
$ pnpm ls
Legend: production dependency, optional only, dev only
[email protected] F:\...\vite-lightningcss (PRIVATE)
devDependencies:
lightningcss 1.25.0
typescript 5.4.5
vite 5.2.11
$ pnpm -v
9.1.2
from lightningcss.
I am seeing this issue using nx
and react / vite apps.
from lightningcss.
Anyone have a workaround for this yet?
from lightningcss.
I had this issue and I found it was caused from importing from lightningcss in a runtime file
I accidentally had this in a file that was running in the browser:
import {transform} from "lightningcss"
When I removed it, it worked
from lightningcss.
Related Issues (20)
- A message about ignoring properties like postcss HOT 1
- Minifier Breaks Black Translucent Colors HOT 2
- Using Lightning as a code generator HOT 2
- Moving back to upstream `selectors`? HOT 2
- transcribes OKLCH poorly HOT 1
- Sourcemap @include paths not updated HOT 2
- Allow use of "resolver" when using through vite HOT 1
- Minification strips required whitespace between consecutive `var(...)` calls HOT 3
- Color value format HOT 4
- Lightningcss randomly drops a selector, breaking styling
- cli: mis-match between --version and npm package version HOT 1
- [Feature Request]: Support `generate(ast)` API like `csstree`
- Support `overlay` property
- Position of `all` property is not maintained HOT 3
- Add support for custom import resolvers in synchronous bundle API
- Use browserslist entry in package.json (vite)
- lots of :lang() in output HOT 3
- Lightning with Astro: Can't resolve background-image path HOT 1
- Unexpected Token Error with "all" property
- Alias another CSS module file to avoid repeating (long) filepaths
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightningcss.