parcel-bundler / parcel-bundler/lightningcss

Use lightningCSS in browser shows error : failed to load resource `fs`

Open
#676 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage
Dominant language
Rust
Stars
7.7k
Forks
302
PR merge metrics
No merged PRs in 30d

Description

Use code from tutorial here
https://lightningcss.dev/docs.html#from-deno-or-in-browser

Shows error since it's try to load module which doesn't exist in browser environment
https://cdn.jsdelivr.net/npm/fs/+esm

Remove fs when import in browser could help ?

Screenshot from 2024-02-12 00-44-22

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the browser example in the lightningcss.dev tutorial and reproduce the failure shown in the issue. Inspect how the example imports its modules and verify the generated browser request for fs. Done means the documented browser example runs without attempting to load the unavailable fs resource.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.