pmndrs / swc-jotai

MIT License
90 stars 14 forks source link

TypeError: Cannot use 'in' operator to search for 'scope' in undefined #2

Closed ImBIOS closed 1 year ago

ImBIOS commented 1 year ago

📜 Description

image

The experimental feature in Next.js with one or both plugins introduces an error like the screenshot above.

💻 System Information

next: ^13.0.2, next-pwa: ^5.6.0, jotai: 1.9.2, swc-jotai/debug-label: 0.0.6, swc-jotai/react-refresh: 0.0.2, node v18.12.0 yarn v1.22.19 Windows 11 21H2 via WSL2 (Ubuntu 22.04.1 LTS)

🔃 How to Reproduce

  1. Install all of the required packages above yarn add ...
  2. Configure the next.config.js to enable the SWC Experimental Plugin feature
  3. Run it with yarn dev
  4. Voila! 💨 The project was working fine without the swc-jotai, but it now shows this error.

Codesandbox: ImBIOS/next-swc-jotai-plugin-bug-lab

👋 Need Help!

Is there any other information that can help debug this issue? Please let me know in the comment below.

Thisen commented 1 year ago

Is there any other information that can help debug this issue?

@ImBIOS Please provide a reproduction 🙏🏼

ImBIOS commented 1 year ago

@ImBIOS Please provide a reproduction 🙏🏼

@Thisen, I've updated the issue description. Is there any other way I can help to debug it? I wonder if it is just my error or if the unstable library is the problem.

Thisen commented 1 year ago

@ImBIOS Please provide a reproduction 🙏🏼

@Thisen, I've updated the issue description. Is there any other way I can help to debug it? I wonder if it is just my error or if the unstable library is the problem.

@ImBIOS Can you provide a Codesandbox?

ImBIOS commented 1 year ago

@ImBIOS Can you provide a Codesandbox?

Here is the Codesandbox link

Thisen commented 1 year ago

@ImBIOS Can you provide a Codesandbox?

Here is the Codesandbox link

I can't access the Codesandbox, something wrong with the instance. Can you resolve it?

ImBIOS commented 1 year ago

I can't access the Codesandbox, something wrong with the instance. Can you resolve it?

image

@Thisen I've tried to access it through both Incognito and Signed-In, and it's successfully reproduced the error. I need more information to know what is happening on your side, like a Screenshot.

Thisen commented 1 year ago

I can't access the Codesandbox, something wrong with the instance. Can you resolve it?

image

@Thisen I've tried to access it through both Incognito and Signed-In, and it's successfully reproduced the error. I need more information to know what is happening on your side, like a Screenshot.

Works now, thanks!

Thisen commented 1 year ago

This should be fixed in @swc-jotai/react-refresh@0.0.3.

Please re-open if that's not the case.

ImBIOS commented 1 year ago

It still needs to be fixed. I have updated the project repository and codesandbox for anyone to reproduce this error.

And... how can I re-open this issue @Thisen ???