OpusCapita / filemanager

React based FileManager for browser ( + FS REST API for Node.js and Express)
https://demo.core.dev.opuscapita.com/filemanager/master/?currentComponentName=FileManager&maxContainerWidth=100%25&showSidebar=false
Apache License 2.0
566 stars 122 forks source link

ReferenceError: self is not defined #253

Closed magpielover closed 5 years ago

magpielover commented 5 years ago

Hello, I'm trying to use the project in my personal React application. I use filemanagermiddleware and the node connector. However, in my first attempt I got the following error. It might not look very descriptive but seems to be a package/version error. Any idea?

ReferenceError: self is not defined at /Users/ugur/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:442:30 at /Users/ugur/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:437:47

kvolkovich-sc commented 5 years ago

Hello, @magpielover. Maybe you can share your project?

There is no way to determine the error reason by information you provided.

magpielover commented 5 years ago

Hi, The project is comprised of a React UI, redux for data management and SSR with Next.js, I have a very light server.js file in the root level where I declare my routes and configs. I created a FileManager component with your "Client React" package in the frontend and followed your guide for creating a middleware. However, when I "npm run", browser displays the error

ReferenceError: self is not defined at /Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:442:30 at /Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:437:47 at module.exports (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:459:68) at Object. (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:32219:36) at webpack_require (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:30:30) at Object.defineProperty.value (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:11973:1) at webpack_require (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:30:30) at Object.defineProperty.value (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:12907:19) at webpack_require (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:30:30) at Object. (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:10502:18) at webpack_require (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:30:30) at Object. (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:32662:18) at __webpack_require__ (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:30:30) at /Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:76:18 at /Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:79:10 at webpackUniversalModuleDefinition (/Users/Desktop/with-redux-wrapper-app/node_modules/@opuscapita/react-filemanager/lib/index.js:3:20)

so not sure what I can tell more about the app. To reproduce the error maybe "/with-redux-wrapper-app" from Next.js can be tested

kvolkovich-sc commented 5 years ago

OK. I'll try to reproduce it with with-redux-wrapper-app. Not right now, but in closest 24 hours :)

kvolkovich-sc commented 5 years ago

Sorry, but I can't reproduce the error.

I'll can't help you if you'll not share a repository to npm install && npm start

magpielover commented 5 years ago

Actually found a hack, I import the module in componentDidMount so it renders in the client side. But thank you for your time.

kvolkovich-sc commented 5 years ago

OK, no problems.

theZulqarnain commented 3 years ago

Actually found a hack, I import the module in componentDidMount so it renders in the client side. But thank you for your time.

@magpielover Can you please share ur code,How did you resolve this issue on Nextjs. Thanks