Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error when trying to compile with 'use client' files. #65896

Open
iliacodes opened this issue May 17, 2024 · 0 comments
Open

Build Error when trying to compile with 'use client' files. #65896

iliacodes opened this issue May 17, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Module Resolution Module resolution (CJS / ESM, module resolving)

Comments

@iliacodes
Copy link

Link to the code that reproduces this issue

https://github.com/iliacodes/test

To Reproduce

Run npx create-next-app@latest

Create a new component with simple text.

Run npm run dev

Change component by adding 'use client' to top of file.

Run npm run dev

Current vs. Expected behavior

Current behavior:

Build Error
Failed to compile

Next.js (14.2.3)
./src/components/Test.tsx
Module parse failed: Expecting Unicode escape sequence \uXXXX (2:55)
| import { createProxy } from "next/dist/build/webpack/loaders/next-flight-loader/module-proxy"
> const proxy = createProxy(String.raw`C:\Users\<user>\Desktop\RepGrp\test\src\components\Test.tsx`)
| 
| // Accessing the __esModule property and exporting $$typeof are required here.
This error occurred during the build process and can only be dismissed by fixing the error._

Expected behavior:
To display text in component in expected area.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 16302
  Available CPU cores: 16
Binaries:
  Node: 20.12.2
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: 14.2.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Module Resolution

Which stage(s) are affected? (Select all that apply)

next build (local), Vercel (Deployed)

Additional context

My username has backticks, haven't really had many issues previously. Figured that must be it. I created a new docker container and the code worked as expected.

After, I google'd and found a discussion previously addressing this issue in 2023
#47736

The issue seemed to have been closed when users updated to 13.3.1-canary.4 and only effected windows users.

Therefore, I tried this version and the 'use client' file worked as expected.

@iliacodes iliacodes added the bug Issue was opened via the bug report template. label May 17, 2024
@github-actions github-actions bot added the Module Resolution Module resolution (CJS / ESM, module resolving) label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Module Resolution Module resolution (CJS / ESM, module resolving)
Projects
None yet
Development

No branches or pull requests

1 participant