fix: yjs duplicate import error (#5297)

This commit is contained in:
Aaryan Khandelwal 2024-08-05 13:37:35 +05:30 committed by GitHub
parent 0619f1b6d1
commit c99f2fcdbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import("next").NextConfig} */
require("dotenv").config({ path: ".env" });
const path = require("path");
const { withSentryConfig } = require("@sentry/nextjs");
const withPWA = require("next-pwa")({
dest: "public",
@ -34,6 +36,13 @@ const nextConfig = {
],
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
// Ensure that all imports of 'yjs' resolve to the same instance
config.resolve.alias["yjs"] = path.resolve(__dirname, "node_modules/yjs");
}
return config;
},
async redirects() {
return [
{