#"use client" results in "[vite] cannot find entry point module '/@id/virtual:use-client-lookup.js'."

1 messages ยท Page 1 of 1 (latest)

mystic veldt
#

Same as this: https://github.com/redwoodjs/sdk/issues/546

I get the same error. Clean install with `npx create-rwsdk my-project-name``

I've identified the error starts happening after v0.1.0-alpha.13

this works:
npx tiged redwoodjs/sdk/starters/standard#v0.1.0-alpha.12 tryredwood

this does not:
npx tiged redwoodjs/sdk/starters/standard#v0.1.0-alpha.13 tryredwood

GitHub

I'm getting the following error as soon as I add `"use client" in a client component. [vite] cannot find entry point module '/@id/virtual:use-client-lookup.js'. I have it on 0...

stray temple
#

Hi @mystic veldt, thank you for helping narrow it down.

A repro would be first prize for helping us figure it out, any possibility you could share some code for this?

mystic veldt
#

I don't touch the code after running the intro, so it should be identical to the code in redwoodjs/sdk/starters/standard#v0.1.0-alpha.13

#

'npx tiged redwoodjs/sdk/starters/standard#v0.1.0-alpha.13 tryredwood`
'cd tryredwood'
'pnpm install'
'pnpm run dev'

stray temple
#

That is super strange. My first thought then is environment differences as this doesnt happen for me or on CI. Could you share:

  • node --version
  • pnpm --version
  • What OS you are running and its version
mystic veldt
#

pnpm --version 8.5.0
node --version v24.3.0

#

mac ventura 13.5.2

stray temple
#

๐Ÿ‘ I'll see if I can repro on those pnpm and node versions, thank you

mystic veldt
#

I'm not sure if this will help, it's mostly confusing to me.

I did this:
nvm install 22
-- Now using node v22.17.0 (npm v10.9.2)

npx tiged redwoodjs/sdk/starters/standard#v0.1.0-alpha.13 tryredwood
cd tryredwood
pnpm install
pnpm run dev

-- Now it worked.

nvm use v24.3.0
pnpm run dev

-- Still working

rm -r tryredwood
npx create-rwsdk tryredwood
-- pnpm install etc.

-- Still working...

-- So now everything works for me as well...

stray temple
#

I'm also confused ๐Ÿ˜„ but this does help still, thank you. @mystic veldt and still [email protected], right?

mystic veldt
#

yea didn't touch that.

stray temple
#

Ok I've tried [email protected][email protected], no dice. So it is seeming more like inconsistent behaviour / race condition / cache-related now. Will investigate along those lines.

@mystic veldt did it happen for you immediately after loading localhost:5173 in your browser after npx tiged redwoodjs/sdk/starters/standard#v0.1.0-alpha.13 tryredwood && pnpm install && pnpm run dev?

#

Aah, one difference that only occurred to me now, is the one case we used npx tiged, the other npx create-rwsdk - will also investigate along those lines

mystic veldt
#

localhost:5173 this always worked, but any page with "use client" like localhost:5173/user/login did not, no matter how long I waited (as far as I could tell)

stray temple
#

got it, thank you ๐Ÿ‘ forgot / doesnt have a use client

mystic veldt
#

I stated with npx create-rwsdk, ran into the issue. Used tiged to narrow down the version (not sure you can pick tag with 'npx create-rwsdk'

stray temple
#

True, ok maybe that's a red herring then

mystic veldt
#

and now it works with tiged as well ๐Ÿ™‚

stray temple
#

Also true ๐Ÿ™ƒ

#

Ok, my gut is telling me this is node_modules/.vite related then, somehow there's some kind of inconsistent behavior there. Will investigate and report back.

In the meantime, it sounds like you're at least unblocked, even if the underlying issue hasn't yet been solved, right?

mystic veldt
#

that is correct. Good luck ๐Ÿ™‚

stray temple