Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion components/copy-migration-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,42 @@ const { withNativewind } = require("nativewind/metro");
module.exports = withNativewind(config);
\`\`\`

### Step 6: Clear Cache and Restart
### Step 6: Override the lightningcss version

Force \`lightningcss\` to a specific version in your \`package.json\` to avoid deserialization errors with \`global.css\` when building:

**npm / bun:** Add to \`package.json\`:
\`\`\`json
{
"overrides": {
"lightningcss": "1.30.1"
}
}
\`\`\`

**yarn:** Add to \`package.json\`:
\`\`\`json
{
"resolutions": {
"lightningcss": "1.30.1"
}
}
\`\`\`

**pnpm:** Add to \`package.json\`:
\`\`\`json
{
"pnpm": {
"overrides": {
"lightningcss": "1.30.1"
}
}
}
\`\`\`

If you don't pin the \`lightningcss\` version, you may encounter deserialization errors with respect to \`global.css\` when building your app.

### Step 7: Clear Cache and Restart

\`\`\`bash
npx expo start --clear
Expand Down Expand Up @@ -471,6 +506,7 @@ Use this checklist to ensure a complete migration:
- [ ] Update \`global.css\` with new Tailwind v4 imports
- [ ] Remove Nativewind from \`babel.config.js\`
- [ ] Update \`metro.config.js\` to remove second argument from \`withNativewind\`
- [ ] Pin \`lightningcss\` to 1.30.1 in \`package.json\` (overrides/resolutions)
- [ ] Clear Metro cache (\`npx expo start --clear\`)
- [ ] Search and replace renamed classes (\`elevation-sm\` → \`elevation-xs\`, etc.)
- [ ] Replace \`{}-[\` with \`@prop-[\` for dynamic modifiers
Expand Down
51 changes: 50 additions & 1 deletion content/blog/v5-migration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,56 @@ Update the `withNativewind` function call (no longer requires a second argument)
+ module.exports = withNativewind(config);
```

### Step 6: Clear Cache and Restart
### Step 6: Override the lightningcss version

Force `lightningcss` to a specific version in your `package.json`:

<Tabs groupId="v5-npm-install" items={["npm", "yarn", "pnpm", "bun"]}>
<Tab value="npm">
```json title="package.json"
{
"overrides": {
"lightningcss": "1.30.1"
}
}
```
</Tab>
<Tab value="yarn">
```json title="package.json"
{
"resolutions": {
"lightningcss": "1.30.1"
}
}
```
</Tab>
<Tab value="pnpm">
```json title="package.json"
{
"pnpm": {
"overrides": {
"lightningcss": "1.30.1"
}
}
}
```
</Tab>
<Tab value="bun">
```json title="package.json"
{
"overrides": {
"lightningcss": "1.30.1"
}
}
```
</Tab>
</Tabs>

<Callout type="warn">
If you don't pin the `lightningcss` version, you may encounter deserialization errors with respect to `global.css` when building your app.
</Callout>

### Step 7: Clear Cache and Restart

```bash
npx expo start --clear
Expand Down
51 changes: 50 additions & 1 deletion content/v5/guides/migrate-from-v4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,56 @@ Update the `withNativewind` function call (no longer requires a second argument)

Note: While `withNativeWind` was renamed to `withNativewind`, either will work.

### Step 6: Clear Cache and Restart
### 6. Override the lightningcss version

Force `lightningcss` to a specific version in your `package.json`:

<Tabs groupId="v5-npm-install" items={["npm", "yarn", "pnpm", "bun"]}>
<Tab value="npm">
```json title="package.json"
{
"overrides": {
"lightningcss": "1.30.1"
}
}
```
</Tab>
<Tab value="yarn">
```json title="package.json"
{
"resolutions": {
"lightningcss": "1.30.1"
}
}
```
</Tab>
<Tab value="pnpm">
```json title="package.json"
{
"pnpm": {
"overrides": {
"lightningcss": "1.30.1"
}
}
}
```
</Tab>
<Tab value="bun">
```json title="package.json"
{
"overrides": {
"lightningcss": "1.30.1"
}
}
```
</Tab>
</Tabs>

<Callout type="warn">
If you don't pin the `lightningcss` version, you may encounter deserialization errors with respect to `global.css` when building your app.
</Callout>

### Step 7: Clear Cache and Restart

```bash
npx expo start --clear
Expand Down