Material UI examples, ReferenceError: Element is not defined - material-ui

I broke one of my next js projects Tried do deploy ssr and next js examples from material ui github repo to codesandbox, same error on both examples.
Downgrading #material-ui/core version 4.9.10 seems to fix the error in the examples. But not in my project, clues where to begin?
Link to Material Ui examples
[ error ] ReferenceError: Element is not defined
at Object.<anonymous> (/tmp/nextjs/node_modules/#material-ui/core/node_modules/react-transition-group/cjs/Transition.js:452:44)
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.<anonymous> (/tmp/nextjs/node_modules/#material-ui/core/node_modules/react-transition-group/cjs/CSSTransition.js:14:42)
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.<anonymous> (/tmp/nextjs/node_modules/#material-ui/core/node_modules/react-transition-group/cjs/index.js:6:45)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
Update:
react-transition-group released version 4.4.1 a few minutes ago. Fixes the issue.

Related

Cloud Function Deployment - TypeError: instance.INTERNAL.registerComponent is not a function

I'm getting this error when I try to deploy Cloud Functions. Have tried with firebase-admin 8.8.0, 8.7.0, and 8.6.1 (the last 3 versions)
Running firebase-functions 3.3.0
Any idea what the problem is? Anyone else have this issue?
Error: Error occurred while parsing your function triggers.
TypeError: instance.INTERNAL.registerComponent is not a function
at registerDatabase (/PATH/cloud-functions/functions/node_modules/firebase-admin/node_modules/#firebase/database/dist/index.node.cjs.js:15165:39)
at Object.<anonymous> (/PATH/cloud-functions/functions/node_modules/firebase-admin/node_modules/#firebase/database/dist/index.node.cjs.js:15196:5)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at FirebaseNamespace.get [as database] (/PATH/cloud-functions/functions/node_modules/firebase-admin/lib/firebase-namespace.js:282:38)
instance.INTERNAL.registerComponent
resides inside firebase/app library
So running npm install #firebase/app --save fixes the issue
In my case, I already had #firebase/app as part of firebase. I also have node 12 installed with Win 10
npm ls #firebase/app
functions# C:\Users\me\source\repos\admin\functions
`-- firebase#5.2.4
`-- #firebase/app#0.6.13
I fixed the issue by updating the firebase dependencies to the latest.
npm i --save firebase#latest firebase-admin#latest firebase-functions#latest
From my package.json:
"firebase": "^8.2.4",
"firebase-admin": "^9.4.2",
"firebase-functions": "^3.13.1",
Note:
Always update firebase-tool to the latest:
npm i -g firebase-tools#lates
Solved on Github. Was a bug in Firebase
https://github.com/firebase/firebase-admin-node/issues/714
https://github.com/firebase/firebase-admin-node/issues/717

Unable to open VS Code due to JavaScript error

Whenever I attempt to open VS Code, I am seeing the following error:
Error Message
Here is the transcript:
Uncaught Exception:
Error: Cannot find module 'C:\Program Files\Microsoft VS Code\resources\app\out\main'
Require stack:
-
at Module._resolveFilename (internal/modules/cjs/loader.js:627:15)
at Function.Module._resolveFilename (C:\Program Files\Microsoft VS Code\resources\electron.asar\common\reset-search-path.js:46:16)
at Function.Module._load (internal/modules/cjs/loader.js:531:27)
at Object.<anonymous> (C:\Program Files\Microsoft VS Code\resources\electron.asar\browser\init.js:191:12)
at Module._compile (internal/modules/cjs/loader.js:645:32)
at Function.Module._load (internal/modules/cjs/loader.js:560:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:850:10)
at internal/main/run_main_module.js:17:11
I am unable to open any projects in VS Code; any attempt throws the same error. I was running VS Code in the same session without any issues prior to receiving this error.

Ionic V1 : Unable to build the ionic APK Cannot find module './array/insert'

Hi I am trying to build an application based on ionic V1 framework. The application while building throwing following wrror on console.
> ionic-v1 build
[11:49:25] Cannot load gulp: Error: Error in module: .\gulpfile.js:
Error: Cannot find module './array/insert'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\sagar\FourWin\node_modules\bower\lib\node_modules\mout\array.js:23:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
[11:49:25] Cannot run sass task: missing in gulpfile.js
My package.json file is this:
{
.
.
.
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
},
"devDependencies": {
"#ionic/v1-toolkit": "1.0.10",
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": []
}
How to deal with this problem. I tried npm install to see if any package missing but still same error persists
After doing a work around for about 4 hours more, i figured out the problem. I am not sure by what activity the problem has been solved but i am listing my steps here
I have individually upgraded all the associated plugins of gulp as part of dependencies in package.json file.
Problem got resolved but then new problem arrived where it is not finding the Sass file module required to compile sass
Error: Node Sass does not yet support your current environment: Windows 64-bit with
Unsupported runtime (57)
Then i changed my gulp-sass version to "gulp-sass": "^3.1.0" from "gulp-sass": "^2.0.4" in package.json
then i did npm install
ionic cordova build android
Problem solved.
Could you please share with us the content of your gulpfile.js file ? It may be that an internal dependency is not included anymore, as Ionic V1 begin to be old...

Getting error while trying to debug vscode source from vsode - Error: Cannot find module 'winreg'

I am trying to debug vscode source code from vscode itself. While I am trying to debug from the 'Launch VS Code' and press F5, it gives the following error.
Loading "winreg" failed
loader.js:224
Error: Cannot find module 'winreg'
loader.js:227
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (c:\Users\oguz\Documents\workspace\vscode\.build\electron\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at nodeRequire (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1642:28)
at NodeScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:703:39)
at OnlyOnceScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:549:37)
at loadNextPath (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1401:41)
at Object.errorback (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1409:25)
Detail:
loader.js:225
Error: Cannot find module 'winreg'
loader.js:225
Here are the modules that depend on it:
Array(1) ["vs/platform/telemetry/node/workbenchCommonProperti…"]
I've found my own solution. Npm requires winreg module but it could not find it. So, I installed it manually by npm install winreg command. Now I can debug vscode.
https://www.npmjs.com/package/winreg

Error while running conf.js file from Eclipse

I am starting to use protractor using eclipse, configured everything, nodejs, protractor, webdriver, but while running protractor with eclipse I am facing below issue with protractor.
Can someone please help me.
Environment details:
C:\Users\User>protractor --version
Version 5.1.1
C:\Users\User>npm --version
3.10.10
C:\Users\User>npm-windows-upgrade
'npm-windows-upgrade' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\User>node -v
v6.10.3
Error facing
**C:\Users(user)\AppData\Roaming\npm\node_modules\webdriver-manager\built\lib\cli\logger.js:66
info(...msgs) {
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users(user)\AppData\Roaming\npm\node_modules\we
bdriver-manager\built\lib\cli\index.js:8:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)**
The error suggests that there is a error in parsing the Javascript of webdriver-manager. webdriver-manager was updated to ES6 (and that's why we need Node 6+) and threw the ... errors in the past for older version of node.
Based on that I would say that Eclipse is running on an older version. After searching the webdriver-manager git I found this issue. I think it matches your problem and also gives you the steps to check which version of node Eclipse is using.
Hope it helps