njbrown / texturelab

Free, Cross-Platform, GPU-Accelerated Procedural Texture Generator
Other
735 stars 45 forks source link

Import declaration conflicts with local declaration of 'UVGenerator', and how can i use 'npm start' command? #14

Closed xiaoyucai01 closed 4 years ago

xiaoyucai01 commented 4 years ago

Type checking in progress...

App running at:

ERROR in D:/Projects/Electron/texturelab/node_modules/three/src/geometries/ExtrudeGeometry.d.ts 2:10 Import declaration conflicts with local declaration of 'UVGenerator'. 1 | import { CurvePath } from './../extras/core/CurvePath';

2 | import { UVGenerator } from './ExtrudeGeometry'; | ^ 3 | import { Vector2 } from './../math/Vector2'; 4 | import { Vector3 } from './../math/Vector3'; 5 | import { Shape } from './../extras/core/Shape'; ERROR in D:/Projects/Electron/texturelab/node_modules/three/src/materials/ShaderMaterial.d.ts 1:10 Import declaration conflicts with local declaration of 'ShaderMaterialParameters'. 1 | import { ShaderMaterialParameters } from './ShaderMaterial'; | ^ 2 | import { IUniform } from '../renderers/shaders/UniformsLib'; 3 | import { MaterialParameters, Material } from './Material'; 4 | Version: typescript 3.9.6 Time: 6045ms

njbrown commented 4 years ago

Hey, I've always seen this issue but the project still built for me. I updated to a newer version of threejs as suggested here and the error is now gone. Thanks.

Regarding npm start, are you suggesting I use it as an alias for npm run electron:serve?

xiaoyucai01 commented 4 years ago

Hi, thanks for the reply. Now i run npm run electron:serve, and it is compiled successfully, but failed to open it using http://localhost:8080/ with chrome, The error is "Uncaught ReferenceError: require is not defined". I am new to npm and electron etc, I expected to open a desktop application when i run the cmd.

iKlsR commented 4 years ago

@xiaoyucai01 It's an electron application, it's not meant to be ran in the browser out the box. When you serve it should open an application window, if you don't see one, check the console and see if anything is off. Try deleting your node_modules folder and doing a clean build. Also make sure you are actually doing electron:serve and not just serve.

Also I would prefer yarn as the package manager as you get a bit more speed.

njbrown commented 4 years ago

@xiaoyucai01 what are your npm and node versions?

xiaoyucai01 commented 4 years ago

@iKlsR @njbrown npm6.14.5 and node12.18.1, maybe the version is too new. image , image , Above are the results, the second picture is the result that i run the "npm run electron:serve" secondly or later. There is some warnings the first time i run the cmd. Aslo, i installed yarn, and it worked, run successfully, image

iKlsR commented 4 years ago

@njbrown As a rule of thumb, stick to one package manager. They are essentially the same but there are some small inconsistencies here and there and having two lock files will cause issues when you use them interchangeably.

I would update the readme to only build and run with yarn and drop the package-lock json.

You can still go either route if you want the flexibility but that means removing the lock files, keeping both up to date and advising users to not mix these.

njbrown commented 4 years ago

@iKlsR you have a point. If i'm going to keep them both i'm going to have to keep both .lock files up to date.