Uncaught TypeError: Cannot read property ‘length’ of undefined

with threejs r87 i have a problem calling this : console.log(mesh.geometry.faces.length); that worked fine with threejs r74. what is modified? Anyone can help me?
this is the program:

// start
var loaderF = new THREE.FileLoader();
//load a text file a output the result to the console
loaderF.load(
    // resource URL
    'segnalibro.stl',
    // Function when resource is loaded
    function ( data ) {
        // output the text to the console
        //console.log( data );
		console.log("Caricamento modello stl finito");
    },
    // Function called when download progresses
    function ( xhr ) {
        console.log( (xhr.loaded / xhr.total * 100) + '%% loaded' );
    },
    // Function called when download errors
    function ( xhr ) {
        console.error( 'An error happened' );
    }
);
var loader = new THREE.STLLoader();
STLMaterial = new THREE.MeshPhongMaterial({color: 0x7777ff});
loader.load( 'segnalibro.stl', function (geometry) {
STLMaterial = new THREE.MeshPhongMaterial( { color: 0x999999,specular: 0x111111,shininess: 20} );
mesh = new THREE.Mesh(geometry, STLMaterial);
 mesh.geometry.computeBoundingBox();
console.log( mesh);
//console.log(boundingBox);
mesh.rotation.set( - Math.PI / 2, 0,  -Math.PI / 2);
mesh.position.set(-125, 0, 125);
mesh.scale.set(1, 1, 1);
scene.add(mesh);
mesh.receiveShadow=true;
mesh.castShadow=true;	
console.log(mesh.geometry.faces.length);

This form is for three.js bug reports and feature requests only.
This is NOT a help site. Do not ask help questions here.
If you need help, please use stackoverflow.

Describe the bug or feature request in detail.
A code snippet, screenshot, and small-test help us understand.

You can edit for small-test.
http://jsfiddle.net/akmcv7Lh/ (current revision)
http://jsfiddle.net/hw9rcLL8/ (dev)

Three.js version
  • Dev
  • [x ] r87
Browser
  • All of them
  • [x ] Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • [x ] Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “Uncaught TypeError: Cannot read property ‘length’ of undefined

  1. now it work with:

    	var geometry = new THREE.Geometry().fromBufferGeometry( mesh.geometry );
    		console.log( geometry.faces.length );
    		
    		
    		var geomesh = new THREE.Mesh(
    					geometry ,
    					new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 0.5, transparent: true } )
    				);
    		var volumeMesh = calculateVolume(geomesh)/1000;
    

Comments are closed.

Uncaught TypeError: Cannot read property ‘length’ of undefined

Prerequisites

Description

<embedded>:25444 Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at Project.module.exports.Project.setPaths (/Applications/Atom.app/Contents/Resources/app/src/project.js:271:44)
    at /Applications/Atom.app/Contents/Resources/app/src/project.js:143:30

screen shot 2017-10-25 at 1 34 06 pm

Happens with or without atom --safe .

Steps to Reproduce

  1. git clone git@github.com:mozilla/balrog.git
  2. cd balrog
  3. docker-compose up
  4. atom .

Note. The docker-compose up creates a bunch of files in .cache and a bunch of files in ui/node_modules

Expected behavior: [What you expect to happen]
That it opens without errors and that I can open files.

Actual behavior: [What actually happens]
It never opens properly. No side-pane. See screenshot.

Reproduces how often: [What percentage of the time does it reproduce?]
Every time.

Versions

▶ atom --version
Atom    : 1.21.1
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
▶ apm --version
apm  1.18.5
npm  3.10.10
node 6.9.5 x64
python 2.7.11
git 2.9.0

I’m on macOS Sierra, 10.12.6

Additional Information

I don’t know how to debug (or even share) what extensions I have installed that might affect this.

Note that the error only happens after you’ve run docker-compose up which creates a bunch of files. But it’s nevertheless reproducible. The files that are created should all be in .gitignore.

Author: Fantashit

3 thoughts on “Uncaught TypeError: Cannot read property ‘length’ of undefined

  1. I had this same problem but was able to fix it with atom --clear-window-state. It would be nice if you could clear the state for a specific directory.

Comments are closed.

Uncaught TypeError: Cannot read property ‘length’ of undefined

[Enter steps to reproduce:]

Atom: 1.24.0 x64
Electron: 1.6.16
OS: Mac OS X 10.13.3
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property ‘length’ of undefined

At /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329

TypeError: Cannot read property 'length' of undefined
    at ScreenLineBuilder.emitText (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329:30)
    at ScreenLineBuilder.buildScreenLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:141:22)
    at DisplayLayer.getScreenLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:643:41)
    at TextEditorComponent.queryScreenLinesToRender (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:867:57)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:376:16)
    at TextEditorComponent.updateSync (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:274:16)
    at TextEditorComponent.didMouseWheel (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:1550:59)

Commands

     -1:56.7.0 snippets:expand (input.hidden-input)
     -1:56.7.0 editor:indent (input.hidden-input)
  6x -1:56.2.0 core:backspace (input.hidden-input)
     -1:49.1.0 core:save (input.hidden-input)
     -1:45.7.0 editor:newline (input.hidden-input)
     -1:44.3.0 core:save (input.hidden-input)
     -1:16.3.0 emmet:toggle-comment (input.hidden-input)
     -1:16.3.0 editor:toggle-line-comments (input.hidden-input)
  3x -1:15.9.0 core:save (input.hidden-input)
     -0:33.8.0 core:backspace (input.hidden-input)
     -0:32.9.0 core:save (input.hidden-input)
     -0:28.5.0 find-and-replace:show (input.hidden-input)
  3x -0:26.8.0 core:backspace (input.hidden-input)
  4x -0:25.9.0 core:confirm (input.hidden-input)
     -0:19.5.0 editor:newline (input.hidden-input)
  4x -0:18.3.0 core:confirm (input.hidden-input)

Non-Core Packages

2-dark-syntax 1.1.0 
atom-html-preview 0.2.5 
atom-terminal 0.8.0 
blessed-dark-syntax 0.3.0 
city-lights-syntax 1.1.2 
city-lights-ui 1.1.7 
emmet 2.4.3 
snow-dark-syntax 0.1.1 
sort-lines 0.18.0 
terminal-plus 0.14.5 

Author: Fantashit

3 thoughts on “Uncaught TypeError: Cannot read property ‘length’ of undefined

  1. To see this bug I:
    Worked on a elm file in Atom.
    Closed Atom
    Worked on the same Elm file in JetBrains Rider
    Save and close Rider
    Open Atom
    Bug appears:
    Uncaught TypeError: Cannot read property ‘length’ of undefined
    /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329

    To fix
    Quit Atom
    atom –clear-window-state

  2. Just got the same problem, for some reason wen I try to open one project (this happen only at this project) the developer tools window is opened and so the atom stop working for this project. All other projects can run normally at the same time.

    Reseting the window state atom --clear-window-state worked for me

Comments are closed.

Uncaught TypeError: Cannot read property ‘length’ of undefined

  1. Add source.python, string.quoted to spell-check Grammars
  2. Open long python script? Might also be due to folded functions.
  3. Warning appears when scrolling.

Atom: 1.33.0-beta0 x64
Electron: 2.0.11
OS: Microsoft Windows 10 Pro
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property ‘length’ of undefined

At C:\Users\Jimmy Tarr\AppData\Local\atom\app-1.33.0-beta0\resources\app\static\<embedded>:14

TypeError: Cannot read property 'length' of undefined
    at ScreenLineBuilder.emitText (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:14:1108762)
    at ScreenLineBuilder.buildScreenLines (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:14:1104472)
    at DisplayLayer.getScreenLines (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:14:89276)
    at TextEditorComponent.queryScreenLinesToRender (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:11:79320)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:11:69973)
    at TextEditorComponent.updateSync (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:11:67601)
    at TextEditorComponent.didShow (~/AppData/Local/atom/app-1.33.0-beta0/resources/app/static/<embedded>:11:91231)
    at TextEd

Author: Fantashit

1 thought on “Uncaught TypeError: Cannot read property ‘length’ of undefined

  1. Issue are 24 days old, there is any solution?

    EDIT
    atom --clear-window-state Solved the problem.

Comments are closed.