#next-intl Convex Auth integration issue

3 messages · Page 1 of 1 (latest)

white hazelBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

    - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
    - Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
    - Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
    - Avoid tagging staff unless specifically instructed.

    Thank you!
flat bobcat
#

Here is next.config.js:

`
const withNextIntl = require('next-intl/plugin')();

const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.pexels.com',
port: '',
pathname: '/',
},
{
protocol: 'https',
hostname: 'placehold.co',
port: '',
pathname: '/
',
},
],
},
}
module.exports = withNextIntl(nextConfig);

`

And this is the tsconfig.json:

`{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"esModuleInterop": true,
"module": "nodenext",
"moduleResolution": "nodenext",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/": ["./src/"]
},
"strictNullChecks": true,
"strict": false
},
"include": ["next-env.d.ts", "/*.ts", "/.tsx", ".next/types/**/.ts"],
"exclude": ["node_modules"]
}

`

First message was to change package.json with
type: module

#

Then now I get this error:

`file:///C:/Users/besim/VS_CODE_WORKPLACE/JS/Qrab/next.config.js:1
const withNextIntl = require('next-intl/plugin')();
^

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and 'C:\Users\besim\VS_CODE_WORKPLACE\JS\Qrab\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///C:/Users/besim/VS_CODE_WORKPLACE/JS/Qrab/next.config.js:1:22
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async loadConfig (C:\Users\besim\VS_CODE_WORKPLACE\JS\Qrab\node_modules\next\dist\server\config.js:768:36)
at async Module.nextDev (C:\Users\besim\VS_CODE_WORKPLACE\JS\Qrab\node_modules\next\dist\cli\next-dev.js:190:14)

Node.js v20.17.0`

I tried .mjs .cjs none of them worked. I need help anyone?