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

ReferenceError: $ is not defined #132

Closed
joetoth opened this issue Apr 14, 2020 · 7 comments
Closed

ReferenceError: $ is not defined #132

joetoth opened this issue Apr 14, 2020 · 7 comments

Comments

@joetoth
Copy link

joetoth commented Apr 14, 2020

I'm guessing something with npm isn't compiling correctly? Any idea how to debug?

ReferenceError: $ is not defined
(anonymous function)
node_modules/android-emulator-webrtc/emulator/index.js:131
128 | /* 2 /
129 | /
**/ (function(module, exports, webpack_require) {
130 |

131 | $;
132 | /* eslint-disable */
133 |
134 | $; // source: emulator_controller.proto

@wuxxin
Copy link

wuxxin commented Apr 23, 2020

having the same issue while experimenting with the react server, which refuses to work with this ^_ error in the webbrowser console

@wuxxin
Copy link

wuxxin commented Apr 24, 2020

@pokowaka do you have any idea why this happens ?

@pokowaka
Copy link
Collaborator

Hi,

Do you have some steps to reproduce this?

@wuxxin
Copy link

wuxxin commented Apr 25, 2020

Hi, thank you for your answer, steps to reproduce:

  • base system: ubuntu eoan (19.10):
sudo apt-get install libprotobuf-dev libprotoc-dev protobuf-compiler npm
sudo npm i yalc -g
git clone https://github.com/google/android-emulator-container-scripts.git
cd android-emulator-container-scripts
. ./configure.sh
./create_web_container.sh -p user,pass
# takes a long time to complete, no errors are thrown, a few warnings are thrown
# warnings on the bottom of the issue
docker-compose -f js/docker/docker-compose-build.yaml up
  • in another terminal, wait until "emulator_emulator:latest" has health!=starting
docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                   PORTS                                                                            NAMES
a52bd2d8c588        emulator_jwt_signer:latest   "python jwt-provider…"   2 minutes ago       Up 2 minutes             8080/tcp                                                                         docker_jwt_signer_1
742d3f556184        emulator_envoy:latest        "/docker-entrypoint.…"   2 minutes ago       Up 2 minutes             0.0.0.0:8001->8001/tcp, 10000/tcp, 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp   docker_front-envoy_1
b1768b77b971        emulator_nginx:latest        "nginx -g 'daemon of…"   2 minutes ago       Up 2 minutes             80/tcp                                                                           docker_nginx_1
886383d35260        emulator_emulator:latest     "/android/sdk/launch…"   38 hours ago        Up 2 minutes (healthy)   5554-5555/tcp, 8554/tcp                                                          docker_emulator_1
  • start browser, connect to page
firefox https://localhost:443
# empty window is rendered, developer tools console shows:
ReferenceError: $ is not definedindex.js:131
    factory index.js:131
    o index.js:30
    factory index.js:11487
    o index.js:30
    factory index.js:94
    factory index.js:97
    42 index.js:3
    l (index):1
    112 main.b87a3f12.chunk.js:2
    l (index):1
    82 main.b87a3f12.chunk.js:2
    l (index):1
    t (index):1
    r (index):1
    <anonym> main.b87a3f12.chunk.js:2
  • warnings from build:
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN tar write after end
npm WARN react-docgen-markdown-renderer@2.1.3 requires a peer of react-docgen@^2 || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ yalc@1.0.0-pre.35
updated 1 package in 7.824s
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN react-docgen-markdown-renderer@2.1.3 requires a peer of react-docgen@^2 || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
up to date in 3.658s
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  index.js (634 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (634 KiB)
      index.js
WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN react-scripts@3.4.1 requires a peer of typescript@^3.2.1 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@8.0.2 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@8.0.2 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@8.0.2 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

@pokowaka
Copy link
Collaborator

Able to reproduce this on ubuntu gce cloud instance.

@pokowaka
Copy link
Collaborator

We use sed to inject markers in the generated protobuf files to make sure that react disables linting for the files.

It looks like either:

  • sed is not behaving as expected on all platforms
  • make is not behaving as expected on all platforms

Will replace sed with python scripts to reduce platform issues.

@wuxxin
Copy link

wuxxin commented May 14, 2020

@pokowaka thank you, i just tried it out, and i can report success on ubuntu 20.04 (focal), it works as expected

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

3 participants