Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

fix nextjs rendering issue

Aykut Saraç3425f79e1bbf
diff --git a/next.config.js b/next.config.js
index b02a87e2..821aef34 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,11 +1,15 @@
+const withTM = require('next-transpile-modules')(['reaflow']);
+
/** @type {import('next').NextConfig} */
-const nextConfig = {
+const nextConfig = withTM({
exportPathMap: () => ({
'/': { page: '/' },
'/editor': { page: '/editor' },
}),
- reactStrictMode: true,
trailingSlash: true,
-};
+ experimental: {
+ esmExternals: 'loose'
+ }
+});
module.exports = nextConfig;
diff --git a/package.json b/package.json
index 00741a03..6abcc5c2 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "json-visio-next",
"private": true,
- "version": "v1.0.0-beta",
+ "version": "v1.2.0-beta",
"homepage": "https://aykutsarac.github.io",
"scripts": {
"dev": "next dev",
@@ -14,6 +14,7 @@
"dependencies": {
"dagre": "^0.8.5",
"next": "12.0.9",
+ "next-transpile-modules": "^9.0.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-icons": "^4.3.1",
diff --git a/src/containers/LiveEditor/index.tsx b/src/containers/LiveEditor/index.tsx
index 10d37e90..89544703 100644
--- a/src/containers/LiveEditor/index.tsx
+++ b/src/containers/LiveEditor/index.tsx
@@ -1,4 +1,4 @@
-import React from "react";
+import React, { ComponentType } from "react";
import styled from "styled-components";
import {
TransformWrapper,
@@ -6,7 +6,7 @@ import {
ReactZoomPanPinchRef,
} from "react-zoom-pan-pinch";
import { useLocalStorage } from "usehooks-ts";
-import { Canvas, CanvasRef } from "reaflow/dist/index";
+import { Canvas, CanvasRef } from "reaflow";
import { StorageConfig } from "src/typings/global";
import { defaultValue } from "../JsonEditor";
diff --git a/yarn.lock b/yarn.lock
index 573e1d05..e9b82048 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1938,6 +1938,14 @@ emoji-regex@^9.2.2:
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==
+enhanced-resolve@^5.7.0:
+ version "5.9.0"
+ resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.0.tgz#49ac24953ac8452ed8fed2ef1340fc8e043667ee"
+ integrity sha512-weDYmzbBygL7HzGGS26M3hGQx68vehdEg6VUmqSOaFzXExFqlnKuSvsEJCVGQHScS8CQMbrAqftT+AzzHNt/YA==
+ dependencies:
+ graceful-fs "^4.2.4"
+ tapable "^2.2.0"
+
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
@@ -3722,6 +3730,14 @@ nearley@^2.7.10:
railroad-diagrams "^1.0.0"
randexp "0.4.6"
+next-transpile-modules@^9.0.0:
+ version "9.0.0"
+ resolved "https://registry.yarnpkg.com/next-transpile-modules/-/next-transpile-modules-9.0.0.tgz#133b1742af082e61cc76b02a0f12ffd40ce2bf90"
+ integrity sha512-VCNFOazIAnXn1hvgYYSTYMnoWgKgwlYh4lm1pKbSfiB3kj5ZYLcKVhfh3jkPOg1cnd9DP+pte9yCUocdPEUBTQ==
+ dependencies:
+ enhanced-resolve "^5.7.0"
+ escalade "^3.1.1"
+
version "12.0.9"
resolved "https://registry.yarnpkg.com/next/-/next-12.0.9.tgz#4eb3006b63bb866f5c2918ca0003e98f4259e063"
@@ -4655,6 +4671,11 @@ symbol-tree@^3.2.4:
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
+tapable@^2.2.0:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
+ integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
+
tape@^4.9.0:
version "4.15.0"
resolved "https://registry.yarnpkg.com/tape/-/tape-4.15.0.tgz#1b8a9563b4bc7e51302216c137732fb2ce6d1a99"