takahirox / tiny-web-metaverse

A web-based 3D virtual space lightweight framework with high flexibility, extensibility, and easy hosting, built on ECS architecture
MIT License
118 stars 13 forks source link

Issue buidling stream_client package #73

Closed jrjdavidson closed 6 months ago

jrjdavidson commented 7 months ago

following the 'how to build' instruction. I get an error when trying to build the stream_client package. Here is the relevant snippet.


> tiny-web-metaverse@0.0.1 build:stream_client
> cd packages/stream_client && npm run build

> @tiny-web-metaverse/stream_client@0.0.1 build
> webpack && npm run type

@tiny-web-metaverse/stream_client:
  asset stream_client.bundle.js 832 KiB [emitted] [javascript module] (name: main)
  runtime modules 1.16 KiB 6 modules
  modules by path ../../node_modules/ 741 KiB 84 modules
  modules by path ./src/*.ts 17.4 KiB
    ./src/index.ts 28 bytes [built] [code generated]
    ./src/adapter.ts 15 KiB [built] [code generated]
    ./src/logger.ts 1.4 KiB [built] [code generated]
    ./src/socket_utils.ts 1.03 KiB [built] [code generated]
  @tiny-web-metaverse/stream_client (webpack 5.89.0) compiled successfully in 4667 ms

@tiny-web-metaverse/stream_client_examples:
  asset app.bundle.js 835 KiB [emitted] (name: main) 1 related asset
  runtime modules 1.16 KiB 6 modules
  modules by path ../../node_modules/ 741 KiB 84 modules
  modules by path ./ 20.2 KiB
    ./examples/index.ts 2.81 KiB [built] [code generated]
    ./src/adapter.ts 15 KiB [built] [code generated]
    ./src/logger.ts 1.4 KiB [built] [code generated]
    ./src/socket_utils.ts 1.03 KiB [built] [code generated]
  @tiny-web-metaverse/stream_client_examples (webpack 5.89.0) compiled successfully in 4641 ms

> @tiny-web-metaverse/stream_client@0.0.1 type
> dts-bundle-generator -o ./dist/stream_client.bundle.d.ts ./src/index.ts

Compiling input files...
Processing ./src/index.ts

Error: Something went wrong - value cannot be null

running on windows.

takahirox commented 7 months ago

Thanks for the problem report. But I couldn't reproduce the problem on my end. I use Windows + MINGW64.

dts-bundle-generator to generate type declare files seems to fail. Can you directly run dts-bungle-generator and check the verbose error messages if possible?

jrjdavidson commented 7 months ago

here it is. Ihad to cut out some bit due to my comment being too long (maximum is 65536 characters), I marked them with [...] below

tiny-web-metaverse\packages\stream_client> npx dts-bundle-generator -o .\dist\stream_client.bundle.d.ts .\src\index.ts --verbose
Verbose log enabled
Total entries count=1
Compiling input files...
Using config: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/packages/stream_client/tsconfig.json
dts cache:

dts cache match: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/packages/stream_client/src/index.d.ts
[...] // similar message +100x
Input source files:
  D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/packages/stream_client/src/adapter.d.ts
  src/index.d.ts
  D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/node/assert.d.ts
  D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/node/assert/strict.d.ts
  D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/header.d.ts

[...] // similar message +100x

  D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/ws/index.d.ts
Processing .\src\index.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/packages/stream_client/src/adapter.d.ts =======

======= Preparing file: src/index.d.ts =======
No output for file: src/index.d.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/node/assert.d.ts =======
No output for file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/node/assert.d.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/node/assert/strict.d.ts =======
No output for file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/node/assert/strict.d.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/header.d.ts =======
No output for file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/header.d.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/readable.d.ts =======
No output for file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/readable.d.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/file.d.ts =======
No output for file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/file.d.ts

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/fetch.d.ts =======
No output for file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/undici-types/fetch.d.ts

[...] // similar message +100*

======= Preparing file: D:/Dropbox (UC Enterprise)/Work/Distance Labs/corejs/tiny-web-metaverse/node_modules/@types/three/src/Three.d.ts =======

Error: Something went wrong - value cannot be null
takahirox commented 7 months ago

Thanks. Hm, an error seems to be caused with Three.js declartion file?

Very hard to investigate the root issue on my end because I can't reproduce...

I just found that an exception seems to be thrown from here for now.

https://github.com/timocov/dts-bundle-generator/blob/d35f76e67511f9820b1cf745105a3fd65c476c48/src/bundle-generator.ts#L633

The commands I ran are exact same as the one in the readme.

$ git clone https://github.com/takahirox/tiny-web-metaverse.git
$ cd tiny-web-metaverse
$ npm run install:all
$ npm run build:all

I tried on Windows + MINGW64 and Windows + Power shell and the both are fine. Please let me know any clue if you have.

jrjdavidson commented 7 months ago

I won't be able to check anything until Monday, but the second 'preparing file' line in the log seems off to me:


======= Preparing file: src/index.d.ts =======
No output for file: src/index.d.ts

It seems all the other line have a full path associated with, it, whereas this on doesn't. Could it be some kind of file path issue? Maybe I'll try mingw

jrjdavidson commented 6 months ago

see https://github.com/timocov/dts-bundle-generator/issues/265 and https://github.com/timocov/dts-bundle-generator/issues/266.

npm install dts-bundle-generator@9.0.0 -D

fixed it for me. I