kentcdodds / kentcdodds/babel-plugin-preval
SyntaxError: Expecting Unicode escape sequence \uXXXX.
- 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.

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
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