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

Bug: Can't import PubNub package #6

Open
Ethorsen opened this issue Aug 27, 2019 · 1 comment
Open

Bug: Can't import PubNub package #6

Ethorsen opened this issue Aug 27, 2019 · 1 comment

Comments

@Ethorsen
Copy link

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Environment

Environment Info:

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
Binaries:
Node: 12.9.1 - E:\nodejs\node.EXE
Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.10.2 - E:\nodejs\npm.CMD
Browsers:
Edge: 41.16299.248.0
Internet Explorer: 11.0.16299.15
npmPackages:
react: ^16.9.0 => 16.9.0
react-dom: ^16.9.0 => 16.9.0
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found

Steps to Reproduce

  1. yarn create react-app --scripts-version @react-workspaces/react-scripts test
  2. cd test && yarn add pubnub
  3. vi src/App.js
  4. Add import pubnub from "pubnub"; at the top
  5. yarn start

Expected Behavior

Start with only a unused warning

Compiled with warnings.

./src/App.js
  Line 4:  'pubnub' is defined but never used  no-unused-vars

Actual Behavior

Compiles but give a runtime error in the browser.
Screenshot_7

Uncaught TypeError: Cannot read property 'fd' of undefined
at Function.useColors (node.js:60)
at createDebug (debug.js:112)
at Object. (index.js:14)
at Object../node_modules/http-proxy-agent/index.js (index.js:110)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/pac-proxy-agent/index.js (index.js:36)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/proxy-agent/index.js (index.js:22)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/superagent-proxy/index.js (index.js:4)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/pubnub/lib/networking/modules/node.js (node.js:11)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/pubnub/lib/node/index.js (index.js:16)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Module../src/App.js (App.css?4433:45)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Module../src/index.js (index.css?f3f6:45)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object.0 (serviceWorker.js:135)
at webpack_require (bootstrap:781)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1

Reproducible Demo

Can't recreate the issue in codesandbox. Creating the issue in a new project as described above is fast and straightforward.

Some tests I did

  1. Tried with nodejs 10.16.3/12.9.1 with same issue.
  2. Tried with official react-scripts 3.0.1 and 3.1.1 and I do not face the issue.

Thanks

DorianScholz added a commit to DorianScholz/create-react-app that referenced this issue Sep 21, 2019
this fixes the issue with the debug lib:
react-workspaces#6
@F1LT3R
Copy link
Collaborator

F1LT3R commented Mar 18, 2020

Are you still trying to get this working?

Zemnmez pushed a commit to Zemnmez/create-react-app that referenced this issue Jul 30, 2020
this fixes the issue with the debug lib:
react-workspaces#6
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

2 participants