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

rpc resolver paths break #4265

Closed
papsavas opened this issue Jan 3, 2024 · 6 comments · Fixed by #4269
Closed

rpc resolver paths break #4265

papsavas opened this issue Jan 3, 2024 · 6 comments · Fixed by #4269
Labels
kind/bug Something isn't working status/done

Comments

@papsavas
Copy link
Contributor

papsavas commented Jan 3, 2024

What is the problem?

Since 2.0.0 build fails on /api/rpc/[[...blitz]].ts with reason:
× Bad character escape sequence, expected 4 hex characters

Paste all your error logs here:

✔ Next.js was successfully patched with a React Suspense fix
✔ Routes manifest was successfully generated
   ▲ Next.js 14.0.4
   - Environments: .env

Failed to compile.

./src/pages/api/rpc/[[...blitz]].ts
Error:
  × Bad character escape sequence, expected 4 hex characters
    ╭─[C:\Users\papsa\PROJECTNAME\src\pages\api\rpc\[[...blitz]].ts:33:1]
 33 │ __internal_addBlitzRpcResolver('/getPasswordResetToken','C:\Users\papsa\PROJECTNAME\src\auth\queries\ge
tPasswordResetToken.ts',() => require('C:/Users/papsa/PROJECTNAME/src/auth/queries/getPasswordResetToken.ts')
);
 34 │ __internal_addBlitzRpcResolver('/deleteAppointment','C:\Users\papsa\PROJECTNAME\src\rpc\appointment\mut
ations\deleteAppointment.ts',() => require('C:/Users/papsa/PROJECTNAME/src/rpc/appointment/mutations/deleteAp
pointment.ts'));
 35 │ __internal_addBlitzRpcResolver('/deleteMyAppointment','C:\Users\papsa\PROJECTNAME\src\rpc\appointment\m
utations\deleteMyAppointment.ts',() => require('C:/Users/papsa/PROJECTNAME/src/rpc/appointment/mutations/dele
teMyAppointment.ts'));
 36 │ __internal_addBlitzRpcResolver('/upsertAppointment','C:\Users\papsa\PROJECTNAME\src\rpc\appointment\mut
ations\upsertAppointment.ts',() => require('C:/Users/papsa/PROJECTNAME/src/rpc/appointment/mutations/upsertAp
pointment.ts'));
    · 
      ──
 37 │ __internal_addBlitzRpcResolver('/upsertMyAppointment','C:\Users\papsa\PROJECTNAME\src\rpc\appointment\m
utations\upsertMyAppointment.ts',() => require('C:/Users/papsa/PROJECTNAME/src/rpc/appointment/mutations/upse
rtMyAppointment.ts'));
 38 │ __internal_addBlitzRpcResolver('/getAppointments','C:\Users\papsa\PROJECTNAME\src\rpc\appointment\queri
es\getAppointments.ts',() => require('C:/Users/papsa/PROJECTNAME/src/rpc/appointment/queries/getAppointments.
ts'));
 39 │ __internal_addBlitzRpcResolver('/getMyAppointments','C:\Users\papsa\PROJECTNAME\src\rpc\appointment\que
ries\getMyAppointments.ts',() => require('C:/Users/papsa/PROJECTNAME/src/rpc/appointment/queries/getMyAppoint
ments.ts'));
    ╰────

Caused by:
    Syntax Error

Import trace for requested module:
./src/pages/api/rpc/[[...blitz]].ts

What are detailed steps to reproduce this?

  1. Upgrade blitz from 2.0.0-beta.36 to 2.0.0

Run blitz -v and paste the output here:

Blitz version: 2.0.0 (local)
Windows 11 | win32-x64 | Node: v18.17.1


 Package manager: pnpm

  System:
    OS: Windows 10 10.0.22621
    CPU: (24) x64 AMD Ryzen 9 7900X 12-Core Processor
    Memory: 21.24 GB / 31.16 GB
  Binaries:
    Node: 18.17.1 - ~\AppData\Local\Volta\tools\image\node\18.17.1\node.EXE
    Yarn: Not Found
    npm: 9.6.7 - ~\AppData\Local\Volta\tools\image\node\18.17.1\npm.CMD
  npmPackages:
    @blitzjs/auth: 2.0.0 => 2.0.0
    @blitzjs/next: 2.0.0 => 2.0.0
    @blitzjs/rpc: 2.0.0 => 2.0.0
    @prisma/client: ^5.6.0 => 5.6.0
    blitz: 2.0.0 => 2.0.0
    next: ^14.0.4 => 14.0.4
    prisma: ^5.6.0 => 5.6.0
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: 5.3.2 => 5.3.2

Please include below any other applicable logs and screenshots that show your problem:

No response

@papsavas papsavas added kind/bug Something isn't working status/triage labels Jan 3, 2024
@siddhsuresh
Copy link
Member

siddhsuresh commented Jan 3, 2024

@papsavas taking a look now. Thanks for reporting the issue!

@tacheometry
Copy link

tacheometry commented Jan 3, 2024

Something similar is happening to me after upgrading to version 2.0.0.

Error:
  × Expected unicode escape

...

Caused by:
    Syntax Error

Import trace for requested module:
./src/pages/api/rpc/[[...blitz]].page.ts

@siddhsuresh
Copy link
Member

@tacheometry are you also a windows user? Can you also paste your blitz -v to make sure its the same issue. Thanks!

@tacheometry @papsavas can you give this version a try 0.0.0-fix-windows-rpc-20240104043406, its a snapshot release from my PR fixing the probable cause, and let me know if it fixes the issue?

@papsavas
Copy link
Contributor Author

papsavas commented Jan 4, 2024

@siddhsuresh built & ran with no problems, thanks for the speedy fix!

@siddhsuresh
Copy link
Member

@papsavas ah that's great! Thanks for the update!

@tacheometry
Copy link

@siddhsuresh Yes I'm on Windows - I installed version 2.0.2 and it's fixed now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/done
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants