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

Use createPaginationContainer cause to look for an un-existing query #67614

Closed
stalinb87 opened this issue Jul 9, 2024 · 5 comments · Fixed by #67768
Closed

Use createPaginationContainer cause to look for an un-existing query #67614

stalinb87 opened this issue Jul 9, 2024 · 5 comments · Fixed by #67768
Assignees
Labels
bug Issue was opened via the bug report template. locked SWC Related to minification/transpilation in Next.js.

Comments

@stalinb87
Copy link

stalinb87 commented Jul 9, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/7tc9th?file=%2F.codesandbox%2Ftasks.json

To Reproduce

  1. Setup a next js application using relay js
  2. Create a component using the createPaginationContainer
  3. Navigate to a page using that component

Current vs. Expected behavior

Current Behavior

It fails to load because is trying to look for a query that doesn't exist it always looks for to.graphql.js
image

Expected behavior

It should load the page without error

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.12.1
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

SWC

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

next dev (local), next build (local), next start (local)

Additional context

The relay compiler seems to be ok with this; if I run pnpm relay-compiler, it works fine

@stalinb87 stalinb87 added the bug Issue was opened via the bug report template. label Jul 9, 2024
@github-actions github-actions bot added the SWC Related to minification/transpilation in Next.js. label Jul 9, 2024
@kdy1 kdy1 self-assigned this Jul 15, 2024
@kdy1
Copy link
Member

kdy1 commented Jul 15, 2024

It looks like an issue of regex for capturing the operation name.

Workaround would be removing query to in the comment.

# Pagination query to be fetched upon calling 'loadMore'.

@kdy1
Copy link
Member

kdy1 commented Jul 15, 2024

swc-project/plugins#333 should fix this

kdy1 added a commit to swc-project/plugins that referenced this issue Jul 15, 2024
@stalinb87
Copy link
Author

That was it, I removed the comment, and it is working, thanks

@kdy1 kdy1 reopened this Jul 15, 2024
@kdy1
Copy link
Member

kdy1 commented Jul 15, 2024

I'll close this once it's properly fixed

@kdy1 kdy1 closed this as completed in 5d757e6 Aug 7, 2024
wyattjoh pushed a commit that referenced this issue Aug 7, 2024
### What?

Update `swc_relay`

### Why?

To fix a bug in operation name parsing. See swc-project/plugins#333



### How?

Fixes #67614
wyattjoh pushed a commit that referenced this issue Aug 12, 2024
### What?

Update `swc_relay`

### Why?

To fix a bug in operation name parsing. See swc-project/plugins#333



### How?

Fixes #67614
wyattjoh pushed a commit that referenced this issue Aug 13, 2024
### What?

Update `swc_relay`

### Why?

To fix a bug in operation name parsing. See swc-project/plugins#333



### How?

Fixes #67614
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked SWC Related to minification/transpilation in Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants