million
million copied to clipboard
bug: Found unsupported argument for block. Make sure blocks consume the reference to a component function, not the direct declaration.
Describe the bug First off, awesome work with thisπͺ!!
Just installed million and trying to use the block as described in the docs. But got the warning for breaking the Rules of Block. Initially I tried to removed parts of my code in the component that I thought could potentially affect this and none of it worked. I then removed my code for the component completely and replaced the whole component with code example show on the github page, but still get the same warning. I'm a bit lost on what could be wrong and how to solve the issue π€, help and a point to the right direction would be much appreciated.
Expected behavior To work as expected.
Screenshots
Additional context package.js: "million": "^2.4.6-beta.0", "react": "^18.2.0", "webpack": "^5.73.0",
Quick question β does this work during runtime? Is it just a warning?
Yes sorry forgot to mention this, the warning accurs during build time. Runtime it does not give any warning or error and everything works.
Should be fixed in v2.4.6-beta.1
!
Wow that was a fast deploy π!
Installed it:
But unfortunatly I still get the same issue π’..
I will be away for a couple of hours now, but if there is anything I can provide I'm more than willing to help. Just write here and I will get back to you as soon as I can!
You rock π€!
This is how the component looks:
import { useState } from "react";
import { block } from "million/react";
const Counter = block(function Counter({ initialCount }) {
const [count, setCount] = useState(1);
const handleClick = () => {
setCount(count + 1);
};
return <button onClick={handleClick}>{count}</button>;
});
export default Counter;
Thank you! Sorry about that, just pushed another fix v2.4.6-beta.2
. If that doesn't work, ping me again!
@aidenybai Hi, got the same error, posted on discord, I didn't saw this issue.
The error is still here even with v2.4.6-beta.2
Thank you! Sorry about that, just pushed another fix
v2.4.6-beta.2
. If that doesn't work, ping me again!
No need to be sorry mate! You do an awesome work with this! π This solved the issue for me, now the error is gone π!
Keep up the great work man! π
@aidenybai Hi, got the same error, posted on discord, I didn't saw this issue. The error is still here even with
v2.4.6-beta.2
Have you tried doing a clean install of the npm packages? Because beta.2 solved this for me.. π€
@aidenybai Hi, got the same error, posted on discord, I didn't saw this issue. The error is still here even with
v2.4.6-beta.2
Have you tried doing a clean install of the npm packages? Because beta.2 solved this for me.. thinking
Hmm, interesting. What do you mean? I'm glad your issues have been resolved by the way!
The issue not gone for me even after clean install. Maybe there's something to do with next.js ?
@ls-devs late, but can you share your usage?
@ls-devs late, but can you share your usage?
Hi @aidenybai you already fixed it. I opened an issue on discord and u fixed it (pseudo discord : Despues)
Hi, I got an error when using vite, any idea?
Hi, I got an error when using vite, any idea?
Hey! Can you share your code so we can reproduce this @coy102? We should probably close this issue for now. Can you open another issue so we can track it?
Thank you @J4v4Scr1pt, @aidenybai!
Hi, I got an error when using vite, any idea?
Hey! Can you share your code so we can reproduce this @coy102? We should probably close this issue for now. Can you open another issue so we can track it?
sure, i'll open another issue, thanks
@coy102 please open another issue, closing this