linkedin / linkedin/css-blocks

Does not work with async files

Open
#152 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Hi, I tried to implement it in my project and ran into a problem. Async components do not correctly handle and delete styles.

An error occurs during the build
`WARNING: Stray reference to block import (styles). Imports are removed during rewrite so this will probably be a runtime error. (/Users/a.marchenko/Downloads/css-blocks-async/src/Strong.jsx:7:28)`

When you run the error
`ReferenceError: styles is not defined`

Example repo - https://github.com/Tom910/css-blocks-async-broken

Contributor guide

Open the contributing guide

Research direction

Start with the linked css-blocks-async-broken example and reproduce the build warning at Strong.jsx:7:28, then trace why the async component's styles reference is removed. Done means async components handle and delete styles without the stray block-import warning or the resulting ReferenceError.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.