-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error module not found , key.json #188
Comments
I am facing the same issue. Works fine in js but not ts |
Was able to make this work by using google api client directly. So instead of that, I did implement it like this, Using App Router: import { google } from "googleapis";
import path from "path";
export async function GET(request: NextRequest) {
const auth = new google.auth.GoogleAuth({
keyFile: path.resolve("public", "google", "client.json"),
scopes: [
"https://www.googleapis.com/auth/youtube",
],
});
google.options({ auth: auth });
console.log(auth);
} |
Can confirm. This breaks in a fresh TS project. |
I got around it by using the Page Router. App Router will not work with this package. |
I have the same problem on NextJs with the app router. |
Works like a charm. Thx |
Need help. I am trying to use App router here using NextJS.
Error says Cannot find module
error Error: Cannot find module 'C:\path\to\project\packages\frontend\public\google\client.json' at webpackEmptyContext (C:\path\to\project\packages\frontend\.next\server\app\api\captions\route.js:22:10)
Now, the
client.json
file is placed inpublic/google
directory and I'm trying to access it in api route.tsThis is the code in
route.ts
// app/api/captions/route.ts
The text was updated successfully, but these errors were encountered: