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

Issues with hooks from a symlinked directory, integrated via workspaces (npm) #49097

Open
1 task done
dominikzogg opened this issue May 2, 2023 · 6 comments
Open
1 task done
Labels
bug Issue was opened via the bug report template.

Comments

@dominikzogg
Copy link

dominikzogg commented May 2, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Mon May  1 00:55:28 UTC 2023
    Binaries:
      Node: 18.16.0
      npm: 9.6.5
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 13.3.1
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

>=13.3.2

Link to the code that reproduces this issue

https://github.com/dominikzogg/reproduction-app

To Reproduce

Use my repo with master branch (next: >=13.3.2) and its broken, use the working-version branch 13.3.1 and it works.

Describe the Bug

When i upgrade next to >=13.3.2 it produces the following error:

../shared/hooks/use-cookie-consent.tsx (10:66) @ undefined
Unhandled Runtime Error
TypeError: dispatcher is null

It seems to work if its not symlinked (no issue on my build pipeline where files where copied to the shared folder within project directory.

I guess its related to: #48506

Expected Behavior

I expect that the code runs as it did until 13.3.1

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@dominikzogg dominikzogg added the bug Issue was opened via the bug report template. label May 2, 2023
@dominikzogg
Copy link
Author

As an information: 13.4.0 still of this issue

@dominikzogg
Copy link
Author

Hello @ijjk

Do you have an idea what is missing there to get any feedback?

Regards Dominik

@ebo-bpi
Copy link

ebo-bpi commented Aug 17, 2023

We seem to have this issue as well. so if you us a "yarn link" with nextjs you will get this error.
no clue on how to solve this.

@dominikzogg
Copy link
Author

@ebo-bpi cause i am using docker also on a local setup instead of symlinks i used docker mounts. Works but is a hack and breaks ide support cause your host system doesn't know about this references

@ebo-bpi
Copy link

ebo-bpi commented Aug 17, 2023

@dominikzogg yep that could be a workaround also. I "fixed" it by importing the package by file path. just point it to the output dir of the remote package. only thing here is that you need to remove this from your package.json before pushing your code.
Again also a workaround, but it won't stop me from moving at least.
Would be nice if this could be solved anyway.

@dominikzogg
Copy link
Author

@ebo-bpi i would already appreciate any response from the developers.

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.
Projects
None yet
Development

No branches or pull requests

2 participants