kentcdodds / kentcdodds/babel-plugin-preval

SyntaxError: Expecting Unicode escape sequence \uXXXX.

Open
#104 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.4k
Forks
48
PR merge metrics
No merged PRs in 30d

Description

- `babel-plugin-preval` version: v5.0.0
- `node` version: v14.17.0
- `npm` (or `yarn`) version: npm v6.14.13

Relevant code or config

```javascript
import tailwindConfig from /* preval */ '../tailwind.config';

export const extractedTailwindConfig = tailwindConfig;
export const extractedTailwindTheme = extractedTailwindConfig.theme;
```

What you did: Suddenly appeared after doing an `npm ci`

What happened:

We're utilizing `babel-plugin-react` in our nextjs project as a way to easily extract tailwind theme config variables. However, after doing an `npm ci` this issue suddenly appeared.

![image](https://user-images.githubusercontent.com/39759024/152590330-f4b0934b-dfce-45dd-acd9-10df37abc932.png)

I'm currently utilizing windows and it seem to flag out the macOS' `/r`. Removing all the new line and sticking everything together seem to fix it.

Any help would be appreciated as we're currently lost with this issue

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the npm ci result on Windows using the shown preval snippet and tailwind.config import, then inspect how the multiline configuration is parsed. Done means the example extracts the Tailwind configuration without the Unicode escape SyntaxError after installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, node.js, tailwindcss
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.