-
Notifications
You must be signed in to change notification settings - Fork 3
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
Usage in Next.js server components #95
Comments
Hi @icrayix, I'm noticing you're using our SDK in a browser based client, in the frontend React code. Our JS SDK doesn't currently support browsers, meaning we haven't officially tested this use case, and we are only claiming compatibility with Node.js. We looked into supporting browser apps so it's not completely uncharted territory, so I will raise this issue internally as a feature request for browser support. To get you unblocked faster, I'm wondering whether your use case can leverage Next.JS's server side rendering feature to run the SDK in a node.js environment and still get your required data on the frontend. |
Hi @AndyTitu, thanks for your response! |
Okay, I see. In this case, I think the problem lays somewhere with the webpack bundling that's going on. Bundlers are also not yet on the supported list of target environments as we have never officially tested for these scenarios (it might be that some do work - like in your case after moving one file around). I'll modify our README to reflect this while we work on better supporting these use cases as well. |
Okay, thanks. I appreciate that! |
Scenario & Reproduction Steps
npx create-next-app@latest
and default optionsnpm install @1password/sdk
app/page.tsx
withnpm run dev
Actual Behavior
When navigating to
localhost:3000
I get the following error in the console:Expected Behavior
No response
SDK version
@1password/sdk@0.1.
Additional information
One fix I found is to run
cp node_modules/@1password/sdk-core/nodejs/core_bg.wasm .next/server/vendor-chunks
AFTER starting the dev server usingnpm run dev
.This has to be run every single time when starting the dev server and thereby is very infeasible.
The text was updated successfully, but these errors were encountered: