projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.65k stars 1.17k forks source link

ReferenceError: self is not defined #851

Open ibytao opened 3 years ago

ibytao commented 3 years ago

ReferenceError: self is not defined at Object. (/Users/nemo/Downloads/react-diagrams/decision-engine/node_modules/@projectstorm/react-diagrams-core/dist/index.umd.js:2:248) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object.hxca (/Users/nemo/Downloads/react-diagrams/decision-engine/.next/server/pages/statistics/query/detail/customCanvas/custom/CustomNodeWidget.js:292:18) at __webpack_require__ (/Users/nemo/Downloads/react-diagrams/decision-engine/.next/server/pages/statistics/query/detail/customCanvas/custom/CustomNodeWidget.js:23:31) at Module.FDMe (/Users/nemo/Downloads/react-diagrams/decision-engine/.next/server/pages/statistics/query/detail/customCanvas/custom/CustomNodeWidget.js:197:91) { type: 'ReferenceError' }

rob-myers commented 3 years ago

Looks like ye olde server-side-rendering issue.

Perhaps using nextjs dynamic import will help:

https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr

rondorkerin commented 1 year ago

This kills types .. not a good solution

kodi commented 6 months ago

Any update on this, is there better way to do this?