Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

These relative modules were not found #235

Open
flyingdove opened this issue Jul 14, 2022 · 4 comments
Open

These relative modules were not found #235

flyingdove opened this issue Jul 14, 2022 · 4 comments

Comments

@flyingdove
Copy link

On npm run serve got this:

These relative modules were not found

  • ../_library/apps/room/proto/room_pb in ./node_modules/ion-sdk-js/lib/connector/room.js
  • ../_library/apps/room/proto/room_pb_service in ./node_modules/ion-sdk-js/lib/connector/room.js
  • ../_library/proto/rtc/rtc_pb in ./node_modules/ion-sdk-js/lib/connector/rtc.js
  • ../_library/proto/rtc/rtc_pb_service in ./node_modules/ion-sdk-js/lib/connector/rtc.js
    No type errors found
    Version: typescript 4.1.6
@jason-shen
Copy link

did you do a npm run install

@robotpilot
Copy link

I also have the same issue.
So, I download and use the file directly as shown below.

$ sudo apt install subversion
$ cd ~/some_package/node_modules/ion-sdk-js/lib/
$ svn export https://github.com/pion/ion-sdk-js.git/trunk/src/_library

@erroric
Copy link

erroric commented Nov 23, 2022

Workaround to automate download missed files on npm install (only Linux, without subversion install, only git binary need):

add scripts/fix_deps.sh in your project folder with content:

#!/bin/sh

set -e

cd $INIT_CWD

if [ -d ./node_modules/ion-sdk-js/lib ] && [ ! -d ./node_modules/ion-sdk-js/lib/_library ]; then
	rm -rf ion-sdk-js
	git clone https://github.com/pion/ion-sdk-js
	mv ./ion-sdk-js/src/_library ./node_modules/ion-sdk-js/lib/
	rm -rf ion-sdk-js
fi

make it executable, and then in your package.json add record in "scripts" section:

"scripts": {
    ......   
    "postinstall": "scripts/fix_deps.sh"
  },

and thats all

@dalaoque
Copy link

dalaoque commented Aug 16, 2023

error ./node_modules/ion-sdk-js/lib/signal/grpc-web-impl.js:7:0

Module not found: Can't resolve '../_library/proto/sfu/sfu_pb_service'

image

I have reviewed the source code and found that the _library directory is just a name, but there are some steps codes in Makefile compilation:

proto: mkdir - p lib===cp rf./src/_library lib

clean: rm - rf src/_library

Deleting the _library directory caused the ESModule not to find the corresponding module when referencing files

cc: @ionorg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants