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

Issue with basePath and Server Actions on client components #71706

Closed
migueldamota opened this issue Oct 23, 2024 · 1 comment · Fixed by #71719
Closed

Issue with basePath and Server Actions on client components #71706

migueldamota opened this issue Oct 23, 2024 · 1 comment · Fixed by #71719
Labels
bug Issue was opened via the bug report template. locked

Comments

@migueldamota
Copy link
Contributor

migueldamota commented Oct 23, 2024

Link to the code that reproduces this issue

https://github.com/migueldamota/nextjs-basepath-issue

To Reproduce

  1. Start app with bun dev --turbo
  2. Go to page (http://localhost:3000/any-path)
  3. Check console for Failed to get source map: Error: Failed to read file contents of... error message

Current vs. Expected behavior

I would expect to not have an error, so that the basePath is removed from the requested file, ignored or trimmed

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 22:08:48 PDT 2024; root:xnu-11215.41.3~5/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 23.0.0
  npm: 10.9.0
  Yarn: 1.22.22
  pnpm: 9.6.0
Relevant Packages:
  next: 15.0.1-canary.3 // Latest available version is detected (15.0.1-canary.3).
  eslint-config-next: N/A
  react: 19.0.0-rc-65a56d0e-20241020
  react-dom: 19.0.0-rc-65a56d0e-20241020
  typescript: 5.6.3
Next.js Config:
  output: N/A

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

Not sure

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

next dev (local)

Additional context

This is only happening when using "use client", when it's removed no error is being logged.
I also checked older versions and it occurs since v15.0.0-canary.184

@migueldamota migueldamota added the bug Issue was opened via the bug report template. label Oct 23, 2024
unstubbable pushed a commit that referenced this issue Oct 23, 2024
This PR fixes #71706.

When having an error client side and there is a `basePath` defined, the
basePath is being used to locate the sourcemap of the given file which
results in an error.

With these changes the `basePath` gets removed from the `filename`
passed to `findSourceMapURL`

If you have questions, feel free to ask!
Copy link
Contributor

github-actions bot commented Nov 7, 2024

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 added the locked label Nov 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant