C
C
cthubqxer2022-04-15 09:22:27
JavaScript
cthubqxer, 2022-04-15 09:22:27

How to connect jsoneditor to nextJS project?

created a new project:

npx create-next-app

I added files from the demo

to it and I get an error when building the project

ReferenceError: self is not defined
at Object. (/home/misha/IdeaProjects/tmp/next-hw/node_modules/jsoneditor/dist/jsoneditor.min.js:30:202)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node :internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.654 (/home/misha/IdeaProjects/tmp/next-hw/.next/server/pages/index.js:52:45)
at __webpack_require__ (/home/misha/IdeaProjects/tmp/next-hw/.next/server/webpack-runtime.js:25:42)
at __webpack_exec__ (/home/misha/IdeaProjects/tmp/next-hw/.next/ server/pages/index.js:345:39) {
type: 'ReferenceError'
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question