supertokens / supertokens-node

Node SDK for SuperTokens core
https://supertokens.com
Other
287 stars 76 forks source link

next/with-emailpassword example doesn't work #699

Closed exKAZUu closed 11 months ago

exKAZUu commented 11 months ago

Reproduction steps

  1. git clone https://github.com/supertokens/supertokens-node.git
  2. cd supertokens-node
  3. npm i
  4. cd examples/next/with-emailpassword
  5. npm i
  6. npm run dev
  7. Open http://localhost:3000/
  8. The following error is shown:
Unhandled Runtime Error
NotSupportedError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree.
image
rtpa25 commented 11 months ago

npm currently does not support local packages satisfactorily. I recommend authors to use yarn instead when using file based refs inside example directory.

rishabhpoddar commented 11 months ago

Hey! Whilst we fix this, in the mean time, try out our CLI instead - npx create-supertokens-app@latest.

nkshah2 commented 11 months ago

Hi @exKAZUu The example app in supertokens-node isnt recommended to be used directly anymore (its mainly present for internal testing). You can use the command @rishabhpoddar posted to set up an app. Closing this issue because theres no action needed here

exKAZUu commented 11 months ago

I see. Thank you for the explanation :bow:

exKAZUu commented 11 months ago

@rishabhpoddar @nkshah2 How can I create an example based on next/with-emailpassword in this repository?

If I select Next.js and Email Password, an example based on https://github.com/supertokens/next.js/tree/canary/examples/with-supertokens seems to be generated.

create-supertokens-app (v0.0.38) lets you quickly get started with using SuperTokens!
Choose your tech stack and the authentication method, we will create a working project that uses SuperTokens for you.
? What is your app called? my-app
? Choose a frontend framework (Visit our documentation for integration with other frameworks): Next.js
? What type of authentication do you want to use? Email Password

The example uses only the pages router, but, I need the example using the app router like https://github.com/supertokens/supertokens-node/tree/master/examples/next/with-emailpassword

The example app in supertokens-node isnt recommended to be used directly anymore (its mainly present for internal testing).

I guess such an example is under development, but I'd like to clarify whether there exists no working example or not.

nkshah2 commented 11 months ago

@exKAZUu

The frontend SDK does not fully support the new app directory yet

exKAZUu commented 11 months ago

I understand. Thanks!