Jupyter Notebook - Cannot read property of undefined - javascript

I have cloned Jupyter notebook from Git repository and installed it in new separate conda environment for development purposes. I have installed correctly as given in https://github.com/jupyter/notebook/blob/master/CONTRIBUTING.rst.
With 'jupyter notebook' command, it runs notebook in the browser, but opens up a blank page instead because of some javascript issues it is getting in browser console. They are:
TypeError: Cannot read property '_' of undefined(…)check #
require.js?v=f960924…:900
Uncaught TypeError: Cannot read property '_' of undefined
underscore.js:15
Failed to parse SourceMap:
http://localhost:8888/static/tree/js/built/1.main.min.js.map
I haven't modified any js code till now. I have just installed it.
How to resolve this issues?

This error is platform specific. There might be some problem on my dev-master. For windows, try following commands:
git log
git checkout 4.2.0
With these commands, you will have fresh checkout and also for webpack build. After that, try following commands:
python setup.py js
python setup.py css
This will extract all js and css dependencies. Now try:
jupyter notebook
Everything works great!

Related

Angular project produces javascript error "core.js:23018 Uncaught TypeError: Cannot read properties of undefined (reading 'id')"

No changes have been made to the project, since it last compiled except for upgrading VSCode
Node: 16.13.0
I am now on 1.68.1 VSCode
Angular 8.3.1 is output of -v
the exact error is above. When debugging through the section it points to, it goes through imports: [, and it complains about LoadingBarHttpClientModule, and LoadingBarRouterModule, i remove those, but then complains about NgxsRootModule , so i give up at this point, not removing that.
in core.js this is the code where it will break in console
function registerNgModuleType(ngModuleType) {
if (ngModuleType.ngModuleDef.id !== null) {
i have tried to disable Angular Language Service but in this version there is no "checkbox" to do so, so i just went to extensions and disabled it.
deleted node_modules, and npm install
restored node_modules, and npm update
restored node_modules, and just run npm install
nothing
Also ever since my development machine was created, i cannot get ng new "commands" to run to create components or modules
If i do Windows Script Host pops up saying
\AppData\Roaming\npm\node_modules#aungular\cli\bin\ng.js
line 1
char 1
invalid character
What gives
I think there is a dependency-version mismatch. You need to
1- Go to C:\Users\${your_user_name_here}\AppData\Roaming\npm and remove content manually if you are on Windows
2- Run npm ci to reinstall clean version packages
Also, you can follow this thread here since the same issue has been resolved similarly

failed to build a react timeline project

https://github.com/daybrush/scenejs-timeline
I'm want to run or build this react project on my PC but come across a bunch of errors. I thought it should have been since I am novice in reactjs. On the other hand, the author of the project has not replied to my issue yet. I am just wondering if there is someone to check it out and either it runs tells me my probable mistake or just tell me this project has some problems on its own.
I downloaded this project through this command:
git clone git#github.com:daybrush/scenejs-timeline.git
Successfully
I want to run the react-scenejs-timeline project under this folder : “scenejs-timeline\packages\react-scenejs-timeline”
by running these commands
npm install
npm start
but when run npm start
The following address opens in the browser
http://localhost:3000/daybrush/scenejs-timelin
And the below errors are shown in the browser console
Uncaught SyntaxError: Unexpected token '<' => bundle.js:1
Manifest: Line: 1, column: 1, Syntax error. => scenejs-timelin/manifest.json:1
What’s the problem?

Create-react-app unable to open IDE when error occurs

I am using create-react-app and everything is working as expected. However I would like that when an error occurs it automatically opens the file in question.
I have set up the .env.local file as suggested.
BROWSER=none
REACT_EDITOR=phpstorm
Error
Note that the development build is not optimized.
To create a production build, use npm run build.
Could not open persistStore.js in the editor.
The editor process exited with an error: spawn phpstorm ENOENT.
To set up the editor integration, add something like REACT_EDITOR=atom to the .env.local file in your project folder and restart the development server.
Maybe this is an error with PhpStorm rather than RCA?

ELM327 Bluetooth OBD-II adapter using Eric Smekens node-bluetooth-obd

Iam getting the following error ReferenceError: require is not defined in browser when i try to run Eric Smekens node-bluetooth-obd test.js
when adding require.js the following error has been seen "error: Module name "../lib/obd.js" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded"
I have tested this on firefox and IE edge any suggestions regarding these errors please.
i am just running them to understand the code though it wont gets execute here.
The module should be used in Node.js environment, not in browser environment.
Install Node.js, then in command-line create a package.json file with npm init, install the module npm install --save bluetooth-obd and then use it in your script like this require('bluetooth-obd'). To run the script, type node myscript.js.

Error: Cannot find module 'entities/lib/decode_codepoint.js'

I am using cheerio module for web scraping . It require htmlparser2 module , after installing htmlparser2. it gives following error-
Error: Cannot find module 'entities/lib/decode_codepoint.js'
Use this in your terminal:
npm install grunt-contrib-jshint --save-dev
Seen here:
https://www.npmjs.com/package/grunt-contrib-jshint
Below is applicable to Windows environment only, not Linux.
I received the same error when I tried to build jquery from source on Windows. It turns out that jsdom and/or grunt-contrib-jshint (both of which depend on htmlparser2) require gyp and for gyp to work you need a c++ compiler and python. I thought that I had them but turned out, that python need to be version 2.x not version 3.x. If it is 3.x it gives you a proper error on the first run (that I missed) and on subsequent runs you are getting the error in the question above which makes you wonder what's going on.
So I uninstalled python 3.x, installed python 2.x (don't forget make sure that python.exe is in your path), then deleted the node_modules folder in the project root and ran the build again.
This time around it worked. I'm not sure if this solves the OP question, but I hope it helps someone.

Categories

Resources