Replies: 1 comment
-
OK, it turns out it's actually working correctly with Next, both the one liner .hasOwnProperty() and an actual MobX makeAutoObservable() example as well. The problem is that the .next folder is caching the compiled files and needs to be manually deleted when changing tsconfig.json. So basically after |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Has anybody set up useDefineForClassFields with recent Next.js, using SWC? (I believe 12+ uses SWC).
My problem is the following:
"useDefineForClassFields": true
At the top of _app.tsx, it'll always throw the error, both in "dev" and in "build".
=> This would mean that useDefineForClassFields is broken in Next / SWC.
feat:Add support for useDefineForClassFields typescript option vercel/next.js#36335
Now that PR has a test which in theory tests this behaviour. In practice I couldn't run the test with "build", only "dev", so I couldn't test it. But let's suppose it's just a small compiler warning, and the PR + test is good.
=> This would mean that useDefineForClassFields works well in Next / SWC and the if hasOwnProperty cannot be used in Next.
Now this is in conflict here. What is the case? Is anyone using it with recent Next?
Beta Was this translation helpful? Give feedback.
All reactions