-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Next / App router example fails with the latest Next.js release #318
Comments
I have copied your package config and it appears to work fine for me. Is this for the app router example? Also, could you try to remove the node_modules directory and the Thankyou! |
Yes, this is for the app router example. The behaviour is the same after removing modules and package-lock.json and reinstalling dependencies. Some additional information: {
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
} And the file producing the error: page.tsx 'use client';
import React from 'react';
import { usePathname } from 'next/navigation';
import dynamic from 'next/dynamic';
export default function Page() {
const path = usePathname();
const segments = path.split('/');
const id = segments[segments.length - 1];
console.log('id:', id);
// need to import the component dynamically as it uses the 'window' property
const DeepChat = dynamic(
() => import('deep-chat-react').then((mod) => mod.DeepChat),
{
ssr: false,
}
);
return (
<>
<main>
<h1>Deep Chat</h1>
<DeepChat
demo={true}
style={{ borderRadius: '10px' }}
textInput={{ placeholder: { text: 'Welcome to the demo!' } }}
/>
</main>
</>
);
} |
Hey @vmorilla. The |
In the meanwhile you can use the following TypeScript workaround:
To note, you will also need to change |
The Next / App router example gives an error with the latest Next.js release:
My package.json file looks like this:
The text was updated successfully, but these errors were encountered: