-
Notifications
You must be signed in to change notification settings - Fork 375
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
[Bug?]: dup signIn import from @solid-mediaket/auth -> build error #1515
Comments
I mean, is this now a bug in |
Hi there, pinging @OrJDev to support on this. Was a similar issue opened in MediaKit? |
Basically when importing from "/" - the signIn function on /client dir is the actual function you should be using, it fully supports ssr, just use it - Related issue This has nothing to do with the solid start repo, its just me creating 2 functions with the same name and exporting both /: |
Yep, @OrJDev , I agree. The Yes, @LukasGerm, I was not aware. More specifically, per @OrJDev, I was not aware to use the 2nd but not the 1st. That's what helped me not discover quickly what had happened. I appreciate the feedback. I'm not pressing for a bug. This cost me a bit of time and my understanding was not clear even though I found a solution. I'm not a fan--just my opinion--that |
Ok since this is not related to SolidStart directly I will close. Follow up in that repo. |
Duplicates
Latest version
Current behavior 😯
Doing a signIn on the top level index page for a site.
Works fine if I import this way.
Fails if I import this way.
I didn't see documentation describing 2 ways to signIn. The change in import was inadvertent and happened via automatic import recommendation in vscode. Maybe doc issue or misread on my part. Seems subtle.
The failure is the attempted use of a server side node module in the client when I do
pnpm build
which is the same asvinxi build
.The import definitions are different.
index.d.ts (fails)
/Users/billm/dev/neutron/hoffa/frontend/dash/webapp/sstart/node_modules/.pnpm/@solid-mediakit+auth@2.0.11_@auth+core@0.29.0_@solidjs+meta@0.29.4_solid-js@1.8.17__@solidjs+_po46vxxkmqdaywwmto3pszjmbi/node_modules/@solid-mediakit/auth/index.d.ts
client.d.ts (works fine)
/Users/billm/dev/neutron/hoffa/frontend/dash/webapp/sstart/node_modules/.pnpm/@solid-mediakit+auth@2.0.11_@auth+core@0.29.0_@solidjs+meta@0.29.4_solid-js@1.8.17__@solidjs+_po46vxxkmqdaywwmto3pszjmbi/node_modules/@solid-mediakit/auth/client.d.ts
Expected behavior 🤔
I expected a single way to import the
signIn
function or better doc to show 2 ways to do it. Intuitively, makes sense to have 2 ways for client side and server side.For me, I didn't read as an import from
@solid-mediakit/auth
and@solid-mediakit/auth/client
to capture the distinction between server-side auth and client-side auth.Steps to reproduce 🕹
Steps:
pnpm create solid
. (project name:test1
; is solid start:Yes
; template:with-authjs
; typescript:Yes
)cd test1
. Editsrc/routes/index.tsx
to importsignIn
from"@solid-mediakit/auth"
instead of the provided"@solid-mediakit/auth/client"
.pnpm i && pnpm build
Context 🔦
I was doing code refactoring after getting the
with-authjs
template working. I wasn't even working with auth at the time. I had introduced some other components and needed to refactor. As I importedsignIn
in a.tsx
, the recommendation from vscode was the wrong one. I didn't even notice and had to bisect current code vs the original template to isolate.Your environment 🌎
The text was updated successfully, but these errors were encountered: